WinWorkstation.st
author Stefan Vogel <sv@exept.de>
Wed, 11 Nov 2009 12:23:05 +0100
changeset 5515 6a8aafa6f151
parent 5485 5c2f4a4e16da
child 5517 3581c9a93da6
permissions -rw-r--r--
changed: #setCursor:in: do not show a changed cursor for one window in all ST/X windows
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
"
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
    12
"{ Package: 'stx:libview' }"
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
    13
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    14
DeviceWorkstation subclass:#WinWorkstation
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    15
	instanceVariableNames:'blackpixel whitepixel listOfFonts rootWin rootDC buttonsPressed
4748
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
    16
		eventTrace eventBuffer isWin95 isWinXP
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
    17
		lastClipboardSequenceNumber'
4261
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
    18
	classVariableNames:'BeepDuration NativeDialogs NativeWidgets NativeWidgetClassTable
2682
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
    19
		StandardColorValues IgnoreSysColorChanges IgnoreFontChanges
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
    20
		SystemColorValues CanEndSession VerboseNativeDialogs'
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
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    25
Object subclass:#AlphaBlendParameters
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    26
	instanceVariableNames:'sourceAlpha padding redMask greenMask blueMask'
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    27
	classVariableNames:''
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    28
	poolDictionaries:''
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    29
	privateIn:WinWorkstation
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    30
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    31
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    32
ByteArray variableByteSubclass:#CopyDataStructStructure
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    33
	instanceVariableNames:''
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    34
	classVariableNames:''
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    35
	poolDictionaries:''
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    36
	privateIn:WinWorkstation
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    37
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    38
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    39
Object subclass:#MonitorInfo
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    40
	instanceVariableNames:'screenX screenY screenW screenH workX workY workW workH isPrimary
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    41
		name'
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    42
	classVariableNames:''
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    43
	poolDictionaries:''
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    44
	privateIn:WinWorkstation
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    45
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    46
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    47
DeviceHandle subclass:#PrinterDeviceContextHandle
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    48
	instanceVariableNames:''
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    49
	classVariableNames:''
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    50
	poolDictionaries:''
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    51
	privateIn:WinWorkstation
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    52
!
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    53
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    54
!WinWorkstation primitiveDefinitions!
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    55
%{
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
    56
#define TRACE_ALL_EVENTS      /* */
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
    57
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    58
#define COUNT_RESOURCES       /* */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    59
#define COUNT_BMP_RESOURCES   /* */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    60
#define DEBUG_DELETEOBJECT    /* */
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
    61
#define DEBUG_DC_REUSE        /* */
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    62
#define xxDEBUG_COLORIZE_WM_PAINT_RECTS1
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    63
#define xxDEBUG_COLORIZE_WM_PAINT_RECTS2
4367
0486a7345d7f *** empty log message ***
penk
parents: 4366
diff changeset
    64
#define LOCK_DEBUG
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
    65
#define xxSTARTUP_DISPATCHTHREAD_DEBUG
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    66
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    67
#define ADJUSTWINDOW
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    68
#define ALWAYSTRUECOLOR
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    69
#define WIN32THREADS
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
    70
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
    71
/* #define DEBUGMASK            /* */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
    72
#define SET_FOCUS_IN_WINTHREAD
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
    73
#define SET_CURSOR_IN_WINTHREAD
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
    74
#define DELAY_ENTER_LEAVE_WHILE_IN_SIZE_MOVE /* */
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
    75
#define xxBEEP_IN_WINTHREAD    /* */
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
    76
#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
    77
#define xxHANDLE_VIEWGRAVITY   /* not yet working */
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    78
#define COMPRESS_WINDOWPOSCHANGED
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    79
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
    80
#define USE_DRAW_MUTEX
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
    81
#define GDIFLUSH_WHEN_CHANGING_CLIP       /* workaround a redraw problem (with dell?) */
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
    82
#define LATE_GENERATE_EXPOSE              /* get update region from stx thread */
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
    83
#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
    84
#define xxLATE_CLEAR_FOR_WM_PAINT         /* fill exposed areas with bgColor in ST/X thread (instead of in event-thread) */
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
    85
					/* seems to be needed to avoid DC conflicts */
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
    86
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
    87
#if 0 /* DOES NOT WORK */
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
    88
#define CACHE_LAST_DC                   /* remember last DC in gcData */
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
    89
#define CACHE_LAST_PEN                  /* remember last pen in gcData */
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
    90
#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
    91
#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
    92
#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
    93
#define CACHE_LAST_TMP_FONT             /* */
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
    94
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
    95
#endif
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
    96
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
    97
#define CACHE_PEN
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
    98
#define CACHE_BRUSH
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
    99
4149
663c31c90a53 optimize displayLine: and define CACHE_LAST_DC
ca
parents: 4145
diff changeset
   100
#ifndef PRE_07_APR_04
663c31c90a53 optimize displayLine: and define CACHE_LAST_DC
ca
parents: 4145
diff changeset
   101
# define CACHE_LAST_DC
663c31c90a53 optimize displayLine: and define CACHE_LAST_DC
ca
parents: 4145
diff changeset
   102
#endif
663c31c90a53 optimize displayLine: and define CACHE_LAST_DC
ca
parents: 4145
diff changeset
   103
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   104
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   105
#ifdef CACHE_PEN
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   106
# 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
   107
# 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
   108
# define MAX_NUM_PEN_CACHED   32         /* upper limit */
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   109
#else
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
   110
# define NUM_PEN_CACHED_W95   0
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
   111
# define NUM_PEN_CACHED_NT    0
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
   112
# define MAX_NUM_PEN_CACHED   0
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   113
#endif
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   114
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   115
#ifdef CACHE_BRUSH
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   116
# 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
   117
# 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
   118
# define MAX_NUM_BRUSH_CACHED 32         /* upper limit */
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
   119
#else
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
   120
# define NUM_BRUSH_CACHED_W95 0
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
   121
# define NUM_BRUSH_CACHED_NT  0
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
   122
# define MAX_NUM_BRUSH_CACHED 0
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   123
#endif
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   124
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   125
#if defined(NO_CLEAR_FOR_WM_PAINT)
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   126
# define WM_PAINT_CLEAR_EARLY       0
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   127
# define WM_PAINT_CLEAR_LATE        0
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   128
#else
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
   129
# if defined(LATE_CLEAR_FOR_WM_PAINT)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   130
#  define WM_PAINT_CLEAR_EARLY       0
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   131
#  define WM_PAINT_CLEAR_LATE        1
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   132
# else
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   133
#  define WM_PAINT_CLEAR_EARLY       1
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   134
#  define WM_PAINT_CLEAR_LATE        0
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   135
# endif
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
   136
#endif
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
   137
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   138
#undef INT
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   139
#define INT WIN_INT
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   140
#undef Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   141
#define Array WIN_Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   142
#undef Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   143
#define Number WIN_Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   144
#undef Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   145
#define Method WIN_Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   146
#undef Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   147
#define Point WIN_Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   148
#undef Rectangle
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   149
/* #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
   150
#undef True
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   151
#define True WIN_True
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   152
#undef False
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   153
#define False WIN_False
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   154
#undef Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   155
#define Block WIN_Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   156
#undef Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   157
#define Context WIN_Context
2766
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   158
#undef Date
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   159
#define Date WIN_Date
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   160
#undef Time
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   161
#define Time WIN_Time
3119
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   162
#undef Delay
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   163
#define Delay WIN_Delay
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   164
#undef Signal
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   165
#define Signal WIN_Signal
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   166
#undef Set
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   167
#define Set WIN_Set
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   168
#undef Process
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   169
#define Process WIN_Process
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   170
#undef Processor
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   171
#define Processor WIN_Processor
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   172
#undef Message
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   173
#define Message WIN_Message
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   174
2328
478ec9b5cbe1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2327
diff changeset
   175
#include <stdio.h>
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   176
#include <errno.h>
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   177
/* #include <malloc.h> */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   178
/* #include <math.h> */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   179
/* #include <string.h> */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   180
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   181
/*#include <stdarg.h>   */
2328
478ec9b5cbe1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2327
diff changeset
   182
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   183
#ifdef __BORLANDC__
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   184
# define NOATOM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   185
# define NOGDICAPMASKS
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   186
# define NOMETAFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   187
# define NOMINMAX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   188
# define NOOPENFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   189
# define NOSOUND
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   190
# define NOWH
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   191
# define NOCOMM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   192
# define NOKANJI
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   193
# define NOCRYPT
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   194
# define NOMCX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   195
# define WIN32_LEAN_AND_MEAN
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   196
# include <windows.h>
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   197
# include <shellapi.h>
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   198
# include <sys\timeb.h>
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   199
# include <dir.h>
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   200
#else
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   201
# define _USERENTRY /**/
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   202
# define NOATOM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   203
# define NOGDICAPMASKS
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   204
# define NOMETAFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   205
# define NOMINMAX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   206
# define NOOPENFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   207
# define NOSOUND
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   208
# define NOWH
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   209
# define NOCOMM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   210
# define NOKANJI
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   211
# define NOCRYPT
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   212
# define NOMCX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   213
# define WIN32_LEAN_AND_MEAN
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   214
# define _WIN32_WINNT 0x0500    /* need this to get certain defines from winuser.h (WM_NCXBUTTONDOWN) */
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   215
# include <windows.h>
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   216
# include <shellapi.h>
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   217
# include <sys\timeb.h>
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   218
#endif
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   219
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   220
#ifndef MAXPATH
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   221
# define MAXPATH 2048   // not define in MS Visual C 8
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   222
#endif
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   223
3521
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
   224
#include <commdlg.h>
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   225
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   226
#include <process.h>
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   227
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   228
#ifdef __DEF_Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   229
# undef Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   230
# define Array __DEF_Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   231
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   232
#ifdef __DEF_Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   233
# undef Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   234
# define Number __DEF_Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   235
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   236
#ifdef __DEF_Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   237
# undef Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   238
# define Method __DEF_Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   239
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   240
#ifdef __DEF_Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   241
# undef Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   242
# define Point __DEF_Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   243
#endif
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   244
#ifdef __DEF_Rectangle
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   245
# undef Rectangle
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   246
# define Rectangle __DEF_Rectangle
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   247
#else
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   248
# undef Rectangle
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   249
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   250
#ifdef __DEF_Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   251
# undef Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   252
# define Block __DEF_Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   253
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   254
#ifdef __DEF_Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   255
# undef Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   256
# define Context __DEF_Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   257
#endif
2766
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   258
#ifdef __DEF_Date
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   259
# undef Date
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   260
# define Date __DEF_Date
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   261
#endif
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   262
#ifdef __DEF_Time
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   263
# undef Time
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   264
# define Time __DEF_Time
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   265
#endif
3119
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   266
# ifdef __DEF_Set
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   267
#  undef Set
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   268
#  define Set __DEF_Set
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   269
# endif
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   270
# ifdef __DEF_Signal
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   271
#  undef Signal
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   272
#  define Signal __DEF_Signal
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   273
# endif
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   274
# ifdef __DEF_Delay
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   275
#  undef Delay
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   276
#  define Delay __DEF_Delay
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   277
# endif
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   278
# ifdef __DEF_Process
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   279
#  undef Process
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   280
#  define Process __DEF_Process
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   281
# endif
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   282
# ifdef __DEF_Processor
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   283
#  undef Processor
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   284
#  define Processor __DEF_Processor
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   285
# endif
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   286
# ifdef __DEF_Message
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   287
#  undef Message
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   288
#  define Message __DEF_Message
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   289
# endif
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   290
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   291
#if 0 /* does not work, anyway */
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   292
#ifndef WM_UNICHAR
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   293
# define WM_UNICHAR                              0x0109
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   294
#endif
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   295
#ifndef UNICODE_NOCHAR
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   296
# define UNICODE_NOCHAR                          0xFFFF
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   297
#endif
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   298
#endif
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   299
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   300
#undef INT
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   301
#define INT int
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   302
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   303
/*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   304
 * some defines - tired of typing ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   305
 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   306
#define _HANDLEVal(o)        (HANDLE)(__MKCP(o))
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   307
#define _HBITMAPVAL(o)       (HBITMAP)(__MKCP(o))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   308
#define _HWNDVal(o)          (HWND)(__MKCP(o))
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   309
#define _HDCVal(o)           (HDC)(__MKCP(o))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   310
#define _HPALETTEVal(o)      (HPALETTE)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   311
#define _HCURSORVal(o)       (HCURSOR)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   312
#define _HGDIOBJVal(o)       (HGDIOBJ)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   313
#define _LOGPALETTEVal(o)    (LOGPALETTE *)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   314
#define _COLORREFVal(o)      (COLORREF)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   315
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   316
#define _GCDATA(o)           ((struct gcData *)(__MKCP(o)))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   317
3498
890cfcba79a5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3497
diff changeset
   318
#define WIDECHAR unsigned short
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
   319
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   320
#ifdef LATER
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   321
  /* 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
   322
   * 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
   323
   * 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
   324
   */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   325
# define __rootDC             (HDC)(__MKCP(__INST(rootDC)))
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   326
#endif
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   327
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   328
#define ISCONNECTED         1
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   329
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   330
struct gcData {
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   331
    union {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   332
	HDC         __hDC;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   333
	struct gcData *__nextFree;
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   334
    } u;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   335
    HWND        hWnd;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   336
    HBITMAP     hBitmap;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   337
    HBITMAP     save_hBitmap;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   338
    HBITMAP     hMask;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   339
    short       clipX;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   340
    short       clipY;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   341
    short       clipW;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   342
    short       clipH;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   343
    char        clipping;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   344
    char        clipByChildren;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   345
    char        bkMode;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   346
    char        bitmapColorBitCount;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   347
    short       maskOrgX;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   348
    short       maskOrgY;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   349
    short       lineWidth;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   350
    short       fontAscent;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   351
    int         lStyle;   /* is lineStyle | joinStyle | capStyle */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   352
    int         rop2;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   353
    int         bitbltrop2;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   354
    COLORREF    fgColor;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   355
    COLORREF    bgColor;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   356
    HFONT       hFont;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   357
    HFONT       save_hFont;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   358
    HPEN        hPen;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   359
    HPEN        save_hPen;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   360
    HBRUSH      hBrush;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   361
    HBRUSH      save_hBrush;
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   362
    char        doNotCacheOrRelease;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   363
    char        reserve1;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   364
    char        reserve2;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   365
    char        reserve3;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   366
    char        reserve4;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   367
    int         reserve5;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   368
};
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   369
#define _hDC u.__hDC
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   370
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   371
/*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   372
 * some synthetic values
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   373
 */
2151
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
 * EVENT DEFINITIONS
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   376
 *****************************************************************/
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   377
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   378
/* 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
   379
   to Grab requests.  Not to be confused with event names.  */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   380
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   381
#define NoEventMask                     0L
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   382
#define KeyPressMask                    (1L<<0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   383
#define KeyReleaseMask                  (1L<<1)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   384
#define ButtonPressMask                 (1L<<2)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   385
#define ButtonReleaseMask               (1L<<3)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   386
#define EnterWindowMask                 (1L<<4)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   387
#define LeaveWindowMask                 (1L<<5)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   388
#define PointerMotionMask               (1L<<6)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   389
#define PointerMotionHintMask           (1L<<7)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   390
#define Button1MotionMask               (1L<<8)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   391
#define Button2MotionMask               (1L<<9)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   392
#define Button3MotionMask               (1L<<10)
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   393
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   394
# define Button4MotionMask               (1L<<11)
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   395
# define Button5MotionMask               (1L<<12)
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   396
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   397
#define ButtonMotionMask                (1L<<13)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   398
#define KeymapStateMask                 (1L<<14)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   399
#define ExposureMask                    (1L<<15)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   400
#define VisibilityChangeMask            (1L<<16)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   401
#define StructureNotifyMask             (1L<<17)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   402
#define ResizeRedirectMask              (1L<<18)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   403
#define SubstructureNotifyMask          (1L<<19)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   404
#define SubstructureRedirectMask        (1L<<20)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   405
#define FocusChangeMask                 (1L<<21)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   406
#define PropertyChangeMask              (1L<<22)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   407
#define ColormapChangeMask              (1L<<23)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   408
#define OwnerGrabButtonMask             (1L<<24)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   409
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   410
/* 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
   411
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
   412
are reserved in the protocol for errors and replies. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   413
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   414
#define KeyPress                2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   415
#define KeyRelease              3
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   416
#define ButtonPress             4
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   417
#define ButtonRelease           5
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   418
#define MotionNotify            6
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   419
#define EnterNotify             7
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   420
#define LeaveNotify             8
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   421
#define FocusIn                 9
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   422
#define FocusOut                10
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   423
#define KeymapNotify            11
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   424
#define Expose                  12
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   425
#define GraphicsExpose          13
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   426
#define NoExpose                14
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   427
#define VisibilityNotify        15
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   428
#define CreateNotify            16
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   429
#define DestroyNotify           17
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   430
#define UnmapNotify             18
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   431
#define MapNotify               19
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   432
#define MapRequest              20
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   433
#define ReparentNotify          21
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   434
#define ConfigureNotify         22
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   435
#define ConfigureRequest        23
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   436
#define GravityNotify           24
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   437
#define ResizeRequest           25
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   438
#define CirculateNotify         26
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   439
#define CirculateRequest        27
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   440
#define PropertyNotify          28
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   441
#define SelectionClear          29
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   442
#define SelectionRequest        30
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   443
#define SelectionNotify         31
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   444
#define ColormapNotify          32
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   445
#define ClientMessage           33
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   446
#define MappingNotify           34
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   447
#define LASTEvent               35      /* must be bigger than any event # */
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
/* 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
   450
   state in various key-, mouse-, and button-related events. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   451
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   452
/* modifier names.  Used to build a SetModifierMapping request or
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   453
   to read a GetModifierMapping request.  These correspond to the
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   454
   masks defined above. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   455
#define ShiftMapIndex           0
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   456
#define LockMapIndex            1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   457
#define ControlMapIndex         2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   458
#define Mod1MapIndex            3
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   459
#define Mod2MapIndex            4
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   460
#define Mod3MapIndex            5
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   461
#define Mod4MapIndex            6
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   462
#define Mod5MapIndex            7
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   463
4946
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   464
#define ShiftMask               (1<<ShiftMapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   465
#define LockMask                (1<<LockMapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   466
#define ControlMask             (1<<ControlMapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   467
#define Mod1Mask                (1<<Mod1MapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   468
#define Mod2Mask                (1<<Mod2MapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   469
#define Mod3Mask                (1<<Mod3MapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   470
#define Mod4Mask                (1<<Mod4MapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   471
#define Mod5Mask                (1<<Mod5MapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   472
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   473
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   474
/* 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
   475
   with button names below. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   476
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   477
#define Button1Mask            Button1MotionMask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   478
#define Button2Mask            Button2MotionMask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   479
#define Button3Mask            Button3MotionMask
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   480
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   481
# define Button4Mask            Button4MotionMask
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   482
# define Button5Mask            Button5MotionMask
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   483
#endif
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   484
#define AnyButtonMask           (Button1Mask|Button2Mask|Button3Mask)
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   485
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   486
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   487
# define AnyModifier             (1<<15)  /* used in GrabButton, GrabKey */
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   488
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   489
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   490
/* 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
   491
   and ButtonRelease events.  Not to be confused with button masks above.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   492
   Note that 0 is already defined above as "AnyButton".  */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   493
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   494
#define Button1                 1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   495
#define Button2                 2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   496
#define Button3                 3
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   497
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   498
# define Button4                 4
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   499
# define Button5                 5
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   500
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   501
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   502
#define CAPTURE_NONE     0
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   503
#define CAPTURE_IMPLICIT 7
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   504
#define CAPTURE_EXPLICIT 8
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   505
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   506
#define BK_UNDEF         0
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   507
#define BK_TRANSPARENT   1
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   508
#define BK_OPAQUE        2
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   509
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   510
#define GRAVITY_NONE        0
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   511
#define GRAVITY_S           1
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   512
#define GRAVITY_SW          2
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   513
#define GRAVITY_SE          3
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   514
#define GRAVITY_N           4
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   515
#define GRAVITY_NW          5
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   516
#define GRAVITY_NE          6
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   517
#define GRAVITY_E           7
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   518
#define GRAVITY_W           8
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   519
4946
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   520
#if 0
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   521
# define ControlMask            8
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   522
# define ShiftMask              16
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   523
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   524
#define LeftAltMask            Mod1Mask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   525
#define RightAltMask           Mod2Mask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   526
#define TRANSLATED_KEY         Mod5Mask
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   527
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   528
#define WIN32PADDING 32
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
   529
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   530
/*
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   531
 * synthetic events
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   532
 */
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   533
#define __WM_MOUSEENTER        0x10001
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   534
#define __WM_MOUSELEAVE        0x10002
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   535
#define __WM_GEXPOSE           0x10003
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   536
#define __WM_NOGEXPOSE         0x10004
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   537
#define __WM_ICONIFIED         0x10005
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
   538
#define __WM_PAINT             0x10006
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   539
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   540
static int AltMask = RightAltMask;
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   541
static int MetaMask = LeftAltMask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   542
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   543
#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
   544
#define BlackPixel     RGB(0, 0, 0)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   545
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   546
/* #undef DEBUG /* */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   547
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   548
#ifdef DEBUG
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   549
# define PRINTF(x)              { console_printf x;}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   550
# define CPRINTF(x)             { if (__debug__ > 1) console_printf x;}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   551
# define RESPRINTF(x)           /*{ if (__debug__) console_printf x;}*/
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   552
# define RES1PRINTF(x)          /*{ if (__debug__) console_printf x;}*/
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   553
# define RES_BMP_PRINTF(x)      /*{ if (__debug__) console_printf x;}*/
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   554
# define TH_DPRINTF(x)          /*{ if (__debug__) console_printf x;}*/
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   555
# define DPRINTF(x)             { if (__debug__) console_printf x;}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   556
# define NDPRINTF(x)            { if (__debugNative__) console_printf x;}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   557
# define NDPRINTF2(x)           { if (__debugNative__ > 1) console_printf x;}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   558
# define DDPRINTF(x)            { if (__debug__ > 1) console_printf x;}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   559
# define BMDPRINTF(x)           { if (__debug__ > 1) console_printf x;}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   560
# define EVENT_PRINTF(x)        { if (__debug__) console_printf x;}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   561
# define EVENT_PRINTF2(x)       { if (__debug__ > 1) console_printf x;}
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   562
# define EVENT_PRINTF3(x)       /* */
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   563
# define DPRINTFIF(flag, x)                 { if (flag) console_printf x;}
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   564
# define EVENT_PRINTFIF(flag, x)            { if (flag && __debug__) console_printf x;}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   565
# define UNHANDLED_EVENT_PRINTF(x)          { if (__debug__) { console_printf("unhandled: "); console_printf x; } }
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   566
# define UNHANDLED_EVENT_PRINTFIF(flag, x)  { if (flag && __debug__) { console_printf("unhandled: "); console_printf x; } }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   567
#else
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   568
# define PRINTF(x)              /* */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   569
# define CPRINTF(x)             /* */
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   570
# define RES_BMP_PRINTF(x)      /* */
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   571
# define RESPRINTF(x)           /* */
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   572
# define RES1PRINTF(x)          /* */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   573
# define TH_DPRINTF(x)          /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   574
# define DPRINTF(x)             /* */
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
   575
# define NDPRINTF(x)            /* */
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
   576
# define NDPRINTF2(x)           /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   577
# define DDPRINTF(x)            /* */
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
   578
# define BMDPRINTF(x)           /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   579
# define EVENT_PRINTF(x)        /* */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   580
# define EVENT_PRINTF2(x)       /* */
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   581
# define EVENT_PRINTF3(x)       /* */
4265
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
   582
# define DPRINTFIF(flag, x)             /* */
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   583
# define EVENT_PRINTFIF(flag, x)        /* */
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   584
# define UNHANDLED_EVENT_PRINTF(x)      /* */
5342
516a8f20d81d Use TextOutA to write one-byte-strings.
Stefan Vogel <sv@exept.de>
parents: 5338
diff changeset
   585
# define UNHANDLED_EVENT_PRINTFIF(flag, x)    /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   586
#endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   587
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
   588
/* # define EVENT_PRINTF(x)        { printf x;} */
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
   589
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   590
#define INFOFPRINTF(__x__)                 \
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   591
    if (@global(InfoPrinting) == true) { \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   592
	console_fprintf __x__;           \
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   593
    }
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   594
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   595
#define DEBUGFPRINTF(__x__)                 \
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
   596
    if (@global(InfoPrinting) == true) { \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   597
	console_fprintf __x__;           \
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
   598
    }
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
   599
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   600
#define BR_SOLID       0
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   601
#define BR_PATTERN     1
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   602
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   603
#define LINE_SOLID     0
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   604
#define LINE_DASH      1
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   605
#define LINE_DDASH     2
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   606
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   607
#ifdef KEEP_STD_CURSORS
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   608
# define _C_ARROW       1
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   609
# define _C_CROSS       2
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   610
# define _C_IBEAM       3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   611
# define _C_ICON        4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   612
# define _C_NO          5
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   613
# define _C_SIZE        6
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   614
# define _C_SIZEALL     7
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   615
# define _C_SIZENESW    8
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   616
# define _C_SIZENS      9
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   617
# define _C_SIZENWSE    10
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   618
# define _C_UPARROW     11
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   619
# define _C_WAIT        12
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   620
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   621
 static HCURSOR H_C_ARROW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   622
 static HCURSOR H_C_CROSS = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   623
 static HCURSOR H_C_IBEAM = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   624
 static HCURSOR H_C_ICON = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   625
 static HCURSOR H_C_NO = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   626
 static HCURSOR H_C_SIZE = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   627
 static HCURSOR H_C_SIZEALL = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   628
 static HCURSOR H_C_SIZENESW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   629
 static HCURSOR H_C_SIZENS = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   630
 static HCURSOR H_C_SIZENWSE = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   631
 static HCURSOR H_C_UPARROW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   632
 static HCURSOR H_C_WAIT = (HCURSOR)0;
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
   633
 static HCURSOR H_C_APPSTARTING = (HCURSOR)0;
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   634
#endif /* KEEP_STD_CURSORS */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   635
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   636
#ifdef EXIT_WITH_3_CTRL_Cs
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
   637
static int ctrl_c_count = 0;            /* CTRL-C count */
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
   638
#endif
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
   639
#ifdef RELEASE_CAPTURE_WITH_3_ESCAPEs
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
   640
static int escape_count = 0;            /* ESCAPE count */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   641
#endif
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   642
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   643
static int evRootX, evRootY;
4476
4ba4a3ac09bc fix: double click in popup windows (affects ExtendedComboBox)
Claus Gittinger <cg@exept.de>
parents: 4462
diff changeset
   644
static int multiClickCount = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   645
static UINT lastMSGTime;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   646
static UINT lastMouseWheelTime = 0;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   647
static int lastClickX, lastClickY;
3584
194203bc4370 last mouse motion
Claus Gittinger <cg@exept.de>
parents: 3583
diff changeset
   648
static int lastMotionX = -9999, lastMotionY = -9999;
194203bc4370 last mouse motion
Claus Gittinger <cg@exept.de>
parents: 3583
diff changeset
   649
static HWND lastMotionWnd = 0;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   650
static int deltaDoubleClickX = -999;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   651
static int deltaDoubleClickY = -999;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   652
static UINT nextMultiClickTime;
4610
4e7993041072 fix: do not treat two quick presses as double-click, if the button is different.
Claus Gittinger <cg@exept.de>
parents: 4578
diff changeset
   653
static OBJ lastButton = 0;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   654
static int inSizeMove = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   655
static int inSize = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   656
static int inMove = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   657
static HWND needDelayedMouseLeaveWindow = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   658
static HWND needDelayedMouseEnterWindow = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   659
static int delayedMouseEnterX, delayedMouseEnterY;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   660
static int destroyWin;
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   661
static HDC   __tmpDC;
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   662
#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
   663
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
   664
#endif
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
   665
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
   666
static int __isWin95 = 0;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   667
static int __isWinNT = 0;
3951
37e3af4c726e bugfix in winNT: set the cursor without checking for mouse point in window
ca
parents: 3895
diff changeset
   668
static int __isWinNT_NEW_BEHAVIOUR = 0;
3714
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   669
static int __isWinXP = 0;
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
   670
static int __isWin2k = 0;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
   671
static int __isWinVista = 0;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
   672
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   673
static int __logPixelSY;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   674
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
   675
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
   676
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
   677
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   678
#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
   679
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
   680
static int            lastGcOwnerThreadID = 0;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   681
static HWND           lastGcHWIN;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   682
static HBITMAP        lastGcHBITMAP;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   683
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   684
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   685
#ifndef __rootDC
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   686
 static HDC __rootDC;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   687
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   688
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   689
#ifdef CACHE_PEN
5342
516a8f20d81d Use TextOutA to write one-byte-strings.
Stefan Vogel <sv@exept.de>
parents: 5338
diff changeset
   690
static struct __penCache {
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   691
    HPEN            pen;
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
   692
    unsigned int    clr;
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
   693
} __penCache[MAX_NUM_PEN_CACHED];
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   694
#endif
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   695
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   696
#ifdef CACHE_BRUSH
5342
516a8f20d81d Use TextOutA to write one-byte-strings.
Stefan Vogel <sv@exept.de>
parents: 5338
diff changeset
   697
static struct __brushCache {
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   698
    HBRUSH          brush;
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
   699
    unsigned int    clr;
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
   700
} __brushCache[MAX_NUM_BRUSH_CACHED];
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   701
#endif
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   702
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   703
/*
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   704
 * globally cached - never released
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   705
 */
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   706
static HPEN __blackPen = 0;
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   707
static HPEN __whitePen = 0;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   708
static HPEN __nullPen = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   709
static HBRUSH __blackBrush = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   710
static HBRUSH __whiteBrush = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   711
2620
519011e49878 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2619
diff changeset
   712
static HPEN __bgPen = 0;
519011e49878 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2619
diff changeset
   713
static int __bgPenColor = 0;
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   714
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
   715
#define WM_THREAD_CREATEWINDOW   (WM_USER + 0x101)
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
   716
#define WM_THREAD_DESTROYWINDOW  (WM_USER + 0x102)
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
   717
#define WM_THREAD_SETFOCUS       (WM_USER + 0x103)
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
   718
#define WM_THREAD_SETCAPTURE     (WM_USER + 0x104)
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
   719
#define WM_THREAD_SETCURSOR      (WM_USER + 0x105)
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
   720
#define WM_THREAD_BEEP           (WM_USER + 0x106)
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
   721
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
   722
#define WM_TRAY_MESSAGE          (WM_USER + 0x200)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   723
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   724
#define hasEventQueued() (eventQueueHead != NULL)
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
   725
#define EVENT_THREAD_STACKSIZE  (4096*10)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   726
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   727
typedef int (*intf)(int);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   728
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   729
/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   730
 * 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
   731
 */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   732
#define LI_TOPWIN       0x0001
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   733
#define LI_INPUTWIN     0x0002
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
   734
#define LI_NATIVEWIN    0x0004
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   735
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   736
typedef struct {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   737
	HCURSOR         hCursor;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   738
	HBRUSH          viewBgBrush;  /* if that is nil, it has a solid bg color */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   739
	COLORREF        viewBgColor;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   740
	int             eventMask;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   741
	short           flag;         /* LI_ - flags bits */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   742
	short           minWidth;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   743
	short           maxWidth;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   744
	short           minHeight;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   745
	short           maxHeight;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   746
	short           bw;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   747
	unsigned char   iconified;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   748
	unsigned char   viewGravity;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   749
	unsigned char   unmapping;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   750
#if 0
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   751
	short           bgOffsX;      /* bg-pattern offset */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   752
	short           bgOffsY;      /* bg-pattern offset */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   753
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   754
	short           mouseX;       /* last mouseX */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   755
	short           mouseY;       /* last mouseY */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   756
	COLORREF        bdColor;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   757
} localWindowInfo;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   758
typedef localWindowInfo *plocalWindowInfo;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   759
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   760
typedef struct createWindowInfo {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   761
	localWindowInfo *localWindowInfo;  /* in param */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   762
	HANDLE          newWinHandle;      /* out param */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   763
	wchar_t         *windowName;       /* in params */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   764
	wchar_t         *className;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   765
	int             winStyleBits;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   766
	int             winStyleBitsEx;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   767
	HANDLE          parentHandle;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   768
	int             x;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   769
	int             y;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   770
	int             dx;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   771
	int             dy;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   772
	HANDLE          hCreateEvent;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   773
	short           infoWasRead;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   774
	unsigned short  sequenceNr;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   775
	unsigned        errCode;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   776
} createWindowInfo;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   777
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   778
#define INVALIDATED_CWI 0xFFFF             /* seqNr for invalidated CWI */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   779
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   780
static createWindowInfo *pendingCREATEWINDOWInfo = 0;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   781
static unsigned short pendingSequenceNr = INVALIDATED_CWI;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   782
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
   783
#ifdef OLD
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
   784
# define GWL_LOCALINFO  0
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
   785
#else
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
   786
# define GWL_LOCALINFO  GWL_USERDATA
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
   787
#endif
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
   788
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   789
#define N_WINDOW_PRIVATE (sizeof(plocalWindowInfo))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   790
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   791
#define GETLOCALWINDOWINFOPTR(__hWnd__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   792
	((localWindowInfo *)GetWindowLong(__hWnd__, GWL_LOCALINFO))
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   793
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   794
#define SETLOCALWINDOWINFOPTR(__hWnd__,__ptr__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   795
	SetWindowLong(__hWnd__, GWL_LOCALINFO , (DWORD)__ptr__)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   796
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   797
#define SetWindow_Cursor(__hWnd__, __hCurs__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   798
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->hCursor = __hCurs__) : 0)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   799
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   800
#define GetWindow_Cursor(__hWnd__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   801
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->hCursor : 0)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   802
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   803
#define SetWindow_viewBgColor(__hWnd__, __viewBgColor__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   804
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->viewBgColor = __viewBgColor__) : 0)
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   805
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   806
#define GetWindow_viewBgColor(__hWnd__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   807
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->viewBgColor : 0)
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   808
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
   809
#define SetWindow_bdColor(__hWnd__, __bdColor__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   810
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->bdColor = __bdColor__) : 0)
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
   811
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
   812
#define GetWindow_bdColor(__hWnd__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   813
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->bdColor : 0)
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
   814
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   815
#define SetWindow_iconified(__hWnd__, __iconified__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   816
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->iconified = __iconified__) : 0)
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   817
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   818
#define GetWindow_iconified(__hWnd__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   819
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->iconified : 0)
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   820
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   821
#define SetWindow_unmapping(__hWnd__, __unmapping__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   822
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->unmapping = __unmapping__) : 0)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   823
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   824
#define GetWindow_unmapping(__hWnd__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   825
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->unmapping : 0)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   826
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   827
#define SetWindow_mouseX(__hWnd__, __mouseX__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   828
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->mouseX = __mouseX__) : 0)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   829
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   830
#define GetWindow_mouseX(__hWnd__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   831
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->mouseX : 0)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   832
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   833
#define SetWindow_mouseY(__hWnd__, __mouseY__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   834
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->mouseY = __mouseY__) : 0)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   835
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   836
#define GetWindow_mouseY(__hWnd__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   837
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->mouseY : 0)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   838
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   839
#define SetWindow_mouseXY(__hWnd__, __mouseX__, __mouseY__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   840
	{ SetWindow_mouseX(__hWnd__, __mouseX__); SetWindow_mouseY(__hWnd__, __mouseY__); }
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   841
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   842
#define SetWindow_viewBgBrush(__hWnd__, __viewBgBrush__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   843
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->viewBgBrush = __viewBgBrush__) : 0)
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   844
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   845
#define GetWindow_viewBgBrush(__hWnd__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   846
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->viewBgBrush : 0)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   847
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   848
#define SetWindow_bw(__hWnd__, __bw__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   849
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->bw = __bw__) : 0)
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   850
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   851
#define GetWindow_bw(__hWnd__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   852
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->bw : 0)
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   853
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   854
#define GetWindow_paintInfoPtr(__hWnd__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   855
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? &(GETLOCALWINDOWINFOPTR(__hWnd__)->paintInfo) : 0)
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   856
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   857
#define GetWindow_sizeInfoPtr(__hWnd__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   858
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? &(GETLOCALWINDOWINFOPTR(__hWnd__)->sizeInfo) : 0)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   859
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   860
#define SetWindow_flag(__hWnd__, __flag__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   861
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->flag = __flag__) : 0)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   862
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   863
#define GetWindow_flag(__hWnd__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   864
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->flag : 0)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   865
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   866
#define GetWindow_eventMask(__hWnd__) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   867
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->eventMask) : 0)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   868
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   869
struct queuedEvent {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   870
	struct queuedEvent     *ev_next;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   871
	int                     count;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   872
	int                     ev_flag;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   873
	HWND                    ev_hWnd;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   874
	UINT                    ev_message;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   875
	UINT                    ev_wParam;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   876
	int                     ev_arg1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   877
	int                     ev_arg2;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   878
	int                     ev_arg3;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   879
	int                     ev_arg4;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
   880
	UINT                    ev_time;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   881
};
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   882
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   883
#define ev_x    ev_arg1
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   884
#define ev_y    ev_arg2
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   885
#define ev_w    ev_arg3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   886
#define ev_h    ev_arg4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   887
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   888
#define ev_keyCode   ev_wParam
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   889
#define ev_scanCode  ev_arg3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   890
#define ev_modifiers ev_arg4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   891
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   892
#define EV_CHUNK_CNT    10000
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   893
#define xxEV_CHUNK_CNT    1000
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   894
#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
   895
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   896
#define BITBLT_COPY             SRCCOPY
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   897
#define BITBLT_COPYINVERTED     NOTSRCCOPY
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   898
#define BITBLT_XOR              SRCINVERT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   899
#define BITBLT_AND              SRCAND
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   900
#define BITBLT_OR               SRCPAINT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   901
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   902
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   903
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   904
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   905
!WinWorkstation primitiveVariables!
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   906
%{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   907
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   908
static int firstInstance = 1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   909
static char *app_name = "ST/X";
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   910
static char *app_nameRoot = "ST/X:Root";
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   911
static char *app_namePopup = "ST/X:Popup";
3714
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   912
static char *app_nameDialog = "ST/X:Dialog";
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   913
static wchar_t wapp_name[] = { 'S','T','/','X',0 };
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   914
static wchar_t wapp_nameRoot[] = { 'S','T','/','X',':','R','o','o','t',0 };
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   915
static wchar_t wapp_namePopup[] = { 'S','T','/','X',':','P','o','p','u','p',0 };
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   916
static wchar_t wapp_nameDialog[] = { 'S','T','/','X',':','D','i','a','l','o','g',0 };
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   917
static int __debug__ = 0;
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   918
static int __debug_WM_MOUSEENTER__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   919
static int __debug_WM_MOUSELEAVE__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   920
static int __debug_WM_MOUSEMOVE__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   921
static int __debug_WM_MOUSEACTIVATE__ = 0;
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   922
static int __debug_WM_CHAR__ = 0;
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   923
static int __debug_WM_KEYUP__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   924
static int __debug_WM_KEYDOWN__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   925
static int __debug_WM_BUTTONUP__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   926
static int __debug_WM_BUTTONDOWN__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   927
static int __debug_WM_PAINT__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   928
static int __debug_WM_MOVING__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   929
static int __debug_WM_ERASEBKGND__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   930
static int __debug_WM_SETTEXT__ = 0;
4265
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
   931
static int __debug_WM_CTLCOLORSCROLLBAR__ = 0;
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
   932
static int __debug_WM_GETICON__ = 0;
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
   933
static int __debug_WM_EXPOSE__ = 0;
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
   934
static int __debug_WM_SIZE__ = 0;
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
   935
static int __debug_WM_WINDOWPOSCHANGING__ = 0;
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
   936
static int __debug_WM_COPYDATA__ = 0;
5230
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
   937
static int __debug_WM_DROPFILES__ = 0;
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
   938
static int __debug_WM_SHOWWINDOW__ = 0;
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
   939
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
   940
static int __debugNative__ = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   941
static int __depth;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   942
static int __realDepth;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   943
static HWND __rootWin = NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   944
static HWND __rootWinSpezial = NULL;
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   945
#if 0
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   946
static HDESK __rootDesk;
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   947
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   948
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   949
static int __activateOnClick = 1;
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   950
static int __focusFollowsMouse = 0;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   951
static int __eatingMouseEvents = 0;
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   952
static int __ignoreButtonPressOnActivate = 0;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   953
static int __rightButtonIsLowerWindow = 1;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   954
static int __shiftedLeftButtonIsLowerWindow = 1;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   955
static int __currentCapture = CAPTURE_NONE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   956
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   957
static HANDLE __currentPointerView = (HANDLE)0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   958
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   959
/* MessageDispatchThread */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   960
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   961
#ifndef WIN32THREADS
4448
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
   962
static HANDLE _masterThread = NULL;
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   963
#endif
4443
96e956cf9acf plugin stuff now in librun
Claus Gittinger <cg@exept.de>
parents: 4441
diff changeset
   964
static DWORD _masterThreadId = 0;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   965
static DWORD _dispatchThreadId = 0;
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
   966
static DWORD _dispatchThreadId2 = 0;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
   967
#ifdef LOCK_DEBUG
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
   968
static int lockCountEvents = 0;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
   969
#endif
4448
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
   970
static HANDLE hEventsMutex = NULL;
4504
0f0a6f7fabd5 lockEvent bug (workaround ?)
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
   971
static char *hEventsMutexOwner = NULL;
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   972
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
   973
#ifdef USE_PAINT_MUTEX
4448
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
   974
static HANDLE hPaintMutex = NULL;
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   975
# define AQUIRE_PAINT_MUTEX    { WaitForSingleObject(hPaintMutex, 100L); }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   976
# define RELEASE_PAINT_MUTEX   { ReleaseMutex(hPaintMutex);              }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   977
#else
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   978
# define AQUIRE_PAINT_MUTEX    { /* nothing */ }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   979
# define RELEASE_PAINT_MUTEX   { /* nothing */ }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   980
#endif
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   981
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   982
#ifdef USE_DRAW_MUTEX
4448
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
   983
static HANDLE hDrawMutex = NULL;
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   984
# define AQUIRE_DRAW_MUTEX     { WaitForSingleObject(hDrawMutex, 100L);  }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   985
# define RELEASE_DRAW_MUTEX    { ReleaseMutex(hDrawMutex);  }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   986
#else
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   987
# define AQUIRE_DRAW_MUTEX     { /* nothing */ }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   988
# define RELEASE_DRAW_MUTEX    { /* nothing */ }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   989
#endif
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
   990
4448
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
   991
static HANDLE hCreateEvent = NULL;
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
   992
static HANDLE hNeverTriggered = NULL;
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
   993
static HANDLE hInputEvent = NULL;
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
   994
static HANDLE hDispatchThreadRunningEvent = NULL;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   995
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   996
#ifdef COUNT_RESOURCES
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   997
 static int __cnt_gcData;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   998
 static int __cnt_createWindows;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   999
 static int __cnt_cur;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1000
 static int __cnt_font;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1001
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1002
#ifdef COUNT_BMP_RESOURCES
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1003
 static int __cnt_bitmap;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1004
#endif
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1005
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1006
static struct queuedEvent *eventFreeList  = (struct queuedEvent *) 0;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1007
static struct queuedEvent *eventQueueHead = (struct queuedEvent *) 0;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1008
static struct queuedEvent *eventQueueTail = (struct queuedEvent *) 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1009
static int eventsendcount = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1010
static int eventempfcount = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1011
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1012
/*
2754
21cbbc8fbe09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
  1013
 * 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
  1014
 * (away from free/malloc)
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1015
 */
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1016
#define NUM_FREE_GC     50
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1017
static struct gcData *gcDataFreeList = (struct gcData *)0;
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1018
static int gcDataNumFree = 0;
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1019
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1020
/*
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1021
 * remember the last background-paint brush
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1022
 * will be reused by next bg-paint, if it needs
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1023
 * the same color. Otherwise, the next bg-erase
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1024
 * will destroy this brush.
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1025
 */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1026
#ifdef CACHE_LAST_WM_PAINT_BRUSH
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1027
 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
  1028
 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
  1029
#endif
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1030
#ifdef CACHE_LAST_WM_PAINT_DC
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1031
 static HWND last_wm_paint_win = 0;
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1032
 static HDC  last_wm_paint_dc = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1033
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1034
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1035
#ifdef COMPRESS_WINDOWPOSCHANGED
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1036
 static HWND lastPos_win = 0;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1037
 static int lastPos_w;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1038
 static int lastPos_h;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1039
 static int lastPos_x;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1040
 static int lastPos_y;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1041
#endif
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1042
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1043
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1044
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1045
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1046
!WinWorkstation primitiveFunctions!
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1047
%{
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1048
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  1049
#ifdef xxWIN32THREADS
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1050
extern void __suspendAktThread();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1051
extern void __resumeAktThread();
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1052
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1053
5342
516a8f20d81d Use TextOutA to write one-byte-strings.
Stefan Vogel <sv@exept.de>
parents: 5338
diff changeset
  1054
static void __debugEvent__() {}
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1055
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1056
#ifdef DEBUGMASK
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1057
static void
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1058
printMask(int mask) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1059
	if (mask & KeyPressMask)        console_printf("KeyPressMask\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1060
	if (mask & KeyReleaseMask)      console_printf("KeyReleaseMask\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1061
	if (mask & ButtonPressMask)     console_printf("ButtonPressMask\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1062
	if (mask & ButtonReleaseMask)   console_printf("ButtonReleaseMask\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1063
	if (mask & ButtonMotionMask)    console_printf("ButtonMotionMask\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1064
	if (mask & PointerMotionMask)   console_printf("PointerMotionMask\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1065
	if (mask & ExposureMask)        console_printf("ExposureMask\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1066
	if (mask & FocusChangeMask)     console_printf("FocusChangeMask\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1067
	if (mask & EnterWindowMask)     console_printf("EnterWindowMask\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1068
	if (mask & LeaveWindowMask)     console_printf("LeaveWindowMask\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1069
	if (mask & KeymapStateMask)     console_printf("KeymapStateMask\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1070
	if (mask & VisibilityChangeMask)console_printf("VisibilityChangeMask\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1071
	if (mask & StructureNotifyMask) console_printf("StructureNotifyMask\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1072
	if (mask & ResizeRedirectMask)  console_printf("ResizeRedirectMask\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1073
	if (mask & PropertyChangeMask)  console_printf("PropertyChangeMask\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1074
	if (mask & ColormapChangeMask)  console_printf("ColormapChangeMask\n");
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1075
}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1076
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1077
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1078
static int
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1079
st2RGB(color, gcData)
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1080
    int color;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1081
    struct gcData *gcData;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1082
{
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1083
	int ir,ig,ib;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1084
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1085
	if (gcData) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1086
	    if (gcData->bitmapColorBitCount == 1) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1087
	      if (color)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1088
		  return WhitePixel;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1089
	      else
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1090
		  return BlackPixel;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1091
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1092
	}
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  1093
#ifdef ALWAYSTRUECOLOR
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1094
	return (color & 0xffffff);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1095
#else
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1096
	if (__depth < 15) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1097
	    return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1098
	} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1099
	    if ((__depth == 16) || (__depth == 15)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1100
		ib = (color & 0x1f) << 3;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1101
		ig = ((color >> 5) & 0x3f) << 2;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1102
		ir = ((color >> 11) & 0x1f) << 3;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1103
		ir |= 7;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1104
		ig |= 3;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1105
		ib |= 7;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1106
		return RGB(ir,ig,ib);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1107
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1108
	    return (color & 0xffffff);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1109
	}
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  1110
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1111
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1112
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1113
static int
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1114
RGB2st(r, g, b)
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1115
    int r, g, b;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1116
{
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1117
	int ir,ig,ib,id;
2418
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
  1118
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  1119
#ifdef ALWAYSTRUECOLOR
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1120
	ir = (r >> 8) & 0xff;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1121
	ig = (g >> 8) & 0xff;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1122
	ib = (b >> 8) & 0xff;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1123
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1124
	id = RGB( ir, ig, ib);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1125
#else
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1126
	if (__depth < 15) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1127
	    id = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1128
	} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1129
	    if ((__depth == 16) || (__depth == 15)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1130
		ir = (r >> 11) & 0x1f;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1131
		ig = (g >> 10) & 0x3f;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1132
		ib = (b >> 11) & 0x1f;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1133
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1134
		id = ( ir << 11 ) | ( ig << 5 ) | ib;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1135
	    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1136
		ir = (r >> 8) & 0xff;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1137
		ig = (g >> 8) & 0xff;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1138
		ib = (b >> 8) & 0xff;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1139
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1140
		id = RGB( ir, ig, ib);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1141
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1142
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1143
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1144
	return id;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1145
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1146
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1147
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1148
/*
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1149
 * return a windows top-window
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1150
 */
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1151
static HWND
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1152
GetTopParent(hWnd)
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1153
    HWND hwnd;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1154
{
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1155
	HWND lastParent = hWnd;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1156
	HWND nextParent;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1157
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1158
	while (nextParent = GetParent(lastParent)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1159
	    lastParent = nextParent;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1160
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1161
	return lastParent;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1162
}
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1163
#endif
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1164
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1165
#ifdef DEBUG_DELETEOBJECT
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1166
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1167
static int
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1168
_DeleteObject(o, lineNr)
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1169
    HANDLE o;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1170
{
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1171
    int r = DeleteObject(o);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1172
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1173
    if (r == 0)
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1174
	console_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
  1175
    return r;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1176
}
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1177
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1178
#else
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1179
# define _DeleteObject(o,lnr)  DeleteObject(o)
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1180
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1181
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1182
static void
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1183
_DeleteFont(f, lineNr)
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1184
    HFONT f;
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1185
{
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1186
#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
  1187
    if (f == __tmpDC_hfont) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1188
	SelectObject(__tmpDC, __tmpDC_prev_hfont);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1189
	__tmpDC_hfont = NULL;
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1190
    }
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1191
#endif
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1192
    _DeleteObject(f, lineNr);
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1193
}
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1194
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1195
static int
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1196
_DeleteBrush(br, lineNr)
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1197
    HBRUSH br;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1198
{
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1199
    int r;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1200
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1201
    if ((br != __whiteBrush)
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1202
     && (br != __blackBrush)) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1203
	r = DeleteObject(br);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1204
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1205
	if (r == 0)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1206
	    console_fprintf(stderr, "WinWorkstation [warning]: ERROR in DeleteBrush %x [%d]\n", br, lineNr);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1207
	return r;
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1208
    }
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1209
    return 1;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1210
}
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1211
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1212
static int
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1213
_DeletePen(p, lineNr)
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1214
    HPEN p;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1215
{
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1216
    int r;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1217
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1218
    if ((p != __whitePen)
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1219
     && (p != __blackPen)) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1220
	r = DeleteObject(p);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1221
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1222
	if (r == 0)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1223
	    console_fprintf(stderr, "WinWorkstation [warning]: ERROR in DeletePen %x [%d]\n", p, lineNr);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1224
	return r;
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1225
    }
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1226
    return 1;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1227
}
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1228
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1229
#ifdef CACHE_PEN
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1230
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1231
static int
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1232
_DeletePenIfNotInCache(p, lineNr)
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1233
    HPEN p;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1234
{
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1235
    int i, r;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1236
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1237
    if ((p == __whitePen)
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1238
     || (p == __blackPen)) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1239
	return 1; /* not deleted, but OK */
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1240
    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  1241
    for (i=0; i<NUM_PEN_CACHED;i++) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1242
	if (__penCache[i].pen == p) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1243
	    return 1; /* not deleted, but OK */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1244
	}
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  1245
    }
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1246
    r = DeleteObject(p);
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1247
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1248
    if (r == 0)
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1249
	console_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
  1250
    return r;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1251
}
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1252
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1253
#else
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1254
# define _DeletePenIfNotInCache(p, lineNr)   _DeletePen(p, lineNr)
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1255
#endif /* CACHE_PEN */
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1256
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1257
#ifdef CACHE_BRUSH
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1258
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1259
static int
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
  1260
_DeleteBrushIfNotInCache(br, lineNr)
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
  1261
    HBRUSH br;
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1262
{
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1263
    int i, r;
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1264
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  1265
    for (i=0; i<NUM_BRUSH_CACHED;i++) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1266
	if (__brushCache[i].brush == br) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1267
	    return 1; /* not deleted, but OK */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1268
	}
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  1269
    }
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
  1270
    if ((br == __whiteBrush)
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
  1271
     || (br == __blackBrush)) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1272
	return 1; /* not deleted, but OK */
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1273
    }
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
  1274
    r = DeleteObject(br);
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1275
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1276
    if (r == 0)
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1277
	console_fprintf(stderr, "WinWorkstation [warning]: ERROR in DeleteBrush2 %x [%d]\n", br, lineNr);
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1278
    return r;
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1279
}
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1280
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1281
#else
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
  1282
# define _DeleteBrushIfNotInCache(br, lineNr)   _DeleteBrush(br, lineNr)
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1283
#endif /* CACHE_BRUSH */
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1284
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1285
static struct gcData *
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1286
newGcData() {
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1287
    struct gcData *gcData;
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1288
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1289
    if (gcDataFreeList) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1290
	gcData = gcDataFreeList;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1291
	gcDataFreeList = gcData->u.__nextFree;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1292
	gcDataNumFree--;
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1293
    } else {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1294
	gcData = (struct gcData *) malloc(sizeof(struct gcData));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1295
	if (! gcData) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1296
	    console_fprintf(stderr, "WinWorkstat [warning]: failed to allocate gcData\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1297
	    return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1298
	}
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1299
    }
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1300
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1301
    memset(gcData, 0, sizeof(struct gcData));
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  1302
    gcData->fgColor = 0xffffff;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1303
    /* gcData->bgColor = 0; - not needed - memset does it */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1304
    gcData->clipping = FALSE;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1305
    gcData->clipByChildren = TRUE;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1306
    gcData->bitbltrop2 = BITBLT_COPY;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1307
    gcData->lineWidth = 1;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1308
    gcData->lStyle = PS_SOLID | PS_JOIN_MITER | PS_ENDCAP_FLAT;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1309
    /* 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
  1310
    /* 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
  1311
    /* gcData->hBrush = 0; - not needed - memset does it */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1312
    return gcData;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1313
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1314
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1315
static void
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1316
freeGcData(gcData)
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1317
    struct gcData *gcData;
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1318
{
2754
21cbbc8fbe09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
  1319
    if (gcDataNumFree < NUM_FREE_GC) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1320
	gcData->u.__nextFree = gcDataFreeList;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1321
	gcDataFreeList = gcData;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1322
	gcDataNumFree++;
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1323
    } else {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1324
	free(gcData);
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1325
    }
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1326
}
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1327
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1328
#ifdef CACHE_LAST_DC
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1329
# 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
  1330
    if (lastGcData == __gcData__) {  \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1331
	_releaseDC(lastGcData);      \
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1332
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1333
#else
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1334
# 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
  1335
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1336
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1337
#ifdef CACHE_LAST_PEN
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1338
# 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
  1339
    if (__gcData__->hPen) {           \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1340
	if (__gcData__->save_hPen) {  \
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1341
	    SelectObject(__gcData__->_hDC, __gcData__->save_hPen); \
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1342
	    __gcData__->save_hPen = 0;   \
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1343
	} \
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1344
	_DeletePenIfNotInCache(__gcData__->hPen, __LINE__); \
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1345
	__gcData__->hPen = 0; \
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1346
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1347
#else
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1348
# 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
  1349
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1350
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1351
#ifdef CACHE_LAST_BRUSH
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1352
# 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
  1353
    if (__gcData__->hBrush) {           \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1354
	if (__gcData__->save_hBrush) {  \
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1355
	    SelectObject(__gcData__->_hDC, __gcData__->save_hBrush); \
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1356
	    __gcData__->save_hBrush = 0;   \
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1357
	} \
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1358
	_DeleteBrushIfNotInCache(__gcData__->hBrush, __LINE__); \
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1359
	__gcData__->hBrush = 0; \
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1360
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1361
#else
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1362
# 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
  1363
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1364
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1365
static void
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1366
_releaseDC(gcData)
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1367
    struct gcData *gcData;
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1368
{
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1369
    HDC hDC = gcData->_hDC;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1370
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1371
    if (gcData->doNotCacheOrRelease ) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1372
	return;
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1373
    }
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1374
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1375
    if (gcData->save_hPen) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1376
	SelectObject(hDC, gcData->save_hPen);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1377
	gcData->save_hPen = 0;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1378
    }
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1379
    if (gcData->save_hBrush) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1380
	SelectObject(hDC, gcData->save_hBrush);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1381
	gcData->save_hBrush = 0;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1382
    }
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1383
    if (gcData->save_hFont) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1384
	SelectObject(hDC, gcData->save_hFont);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1385
	gcData->save_hFont = 0;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1386
    }
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1387
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1388
    if (gcData->hWnd) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1389
	if (hDC) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1390
	    ReleaseDC(gcData->hWnd, hDC);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1391
#ifdef CACHE_LAST_WM_PAINT_DC
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1392
	    if (hDC == last_wm_paint_dc) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1393
		last_wm_paint_dc = last_wm_paint_win = 0;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  1394
# ifdef DEBUG_DC_REUSE
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1395
		console_fprintf(stderr, "WinWorkstation [info]: Oops - releasing bg_paint-dc\n");
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  1396
# endif
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1397
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1398
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1399
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1400
    } else if (gcData->hBitmap) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1401
	SelectObject(hDC, gcData->save_hBitmap);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1402
	DeleteDC(hDC);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1403
    }
2383
9a5be0903b57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2378
diff changeset
  1404
    gcData->_hDC = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1405
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1406
#ifdef CACHE_LAST_DC
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1407
    if (lastGcData == gcData) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1408
	lastGcData = 0;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1409
    }
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1410
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1411
#ifdef CACHE_LAST_PEN
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1412
    if (gcData->hPen) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1413
	_DeletePenIfNotInCache(gcData->hPen, __LINE__);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1414
	gcData->hPen = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1415
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1416
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1417
#ifdef CACHE_LAST_BRUSH
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1418
    if (gcData->hBrush) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1419
	_DeleteBrushIfNotInCache(gcData->hBrush, __LINE__);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1420
	gcData->hBrush = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1421
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1422
#endif
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1423
}
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1424
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1425
static HDC
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1426
_getDC(gcData)
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1427
    struct gcData *gcData;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1428
{
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1429
    HDC hDC;
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1430
    int currThreadId;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1431
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1432
    if (gcData->doNotCacheOrRelease ) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1433
	return gcData->_hDC;
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1434
    }
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1435
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1436
#ifdef CACHE_LAST_DC
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1437
    currThreadId = GetCurrentThreadId();
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  1438
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1439
    if (lastGcData) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1440
	if ((lastGcData == gcData)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1441
	 && (lastGcHWIN == gcData->hWnd)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1442
	 && (lastGcHBITMAP == gcData->hBitmap)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1443
	 && (lastGcOwnerThreadID == currThreadId)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1444
	 && gcData->_hDC
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1445
	) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1446
# ifdef CACHE_LAST_WM_PAINT_DC /* DDD */
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1447
	    if (last_wm_paint_dc == gcData->_hDC) {
2732
bb3d3b26a81c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2728
diff changeset
  1448
#  ifdef DEBUG_DC_REUSE
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1449
		console_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
  1450
#  endif
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1451
		last_wm_paint_dc = last_wm_paint_win = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1452
	    }
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1453
# endif
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1454
	    return gcData->_hDC;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1455
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1456
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1457
	_releaseDC(lastGcData);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1458
	lastGcData = 0;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1459
    }
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1460
#endif
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1461
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1462
    hDC = 0;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1463
    if (gcData->hWnd != 0) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1464
	if (__isWinNT && (gcData->hWnd == __rootWin)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1465
	    hDC = gcData->_hDC = GetDCEx(gcData->hWnd, 0, DCX_WINDOW);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1466
	    //gcData->_hDC = GetDC(gcData->hWnd);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1467
	} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1468
	    if (gcData->clipByChildren) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1469
		//gcData->_hDC = GetDCEx(gcData->hWnd, 0, DCX_CLIPCHILDREN);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1470
		hDC = gcData->_hDC = GetDC(gcData->hWnd);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1471
	    } else
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1472
		hDC = gcData->_hDC = GetDCEx(gcData->hWnd, 0, DCX_PARENTCLIP);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1473
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1474
    } else if (gcData->hBitmap) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1475
	hDC = gcData->_hDC = CreateCompatibleDC(__tmpDC);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1476
	gcData->save_hBitmap = SelectObject(gcData->_hDC,gcData->hBitmap);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1477
    }
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1478
    gcData->bkMode = BK_UNDEF;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1479
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1480
    if (hDC) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1481
#if 0
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1482
	SetTextColor(hDC, gcData->bgColor);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1483
	SetBkColor(hDC, gcData->fgColor);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1484
#else
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1485
	SetTextColor(hDC, gcData->fgColor);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1486
	SetBkColor(hDC, gcData->bgColor);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1487
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1488
	if (gcData->rop2)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1489
	    SetROP2(hDC, gcData->rop2);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1490
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1491
	if (gcData->clipping) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1492
	    HRGN region = CreateRectRgn( gcData->clipX, gcData->clipY,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1493
					 gcData->clipX + gcData->clipW,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1494
					 gcData->clipY + gcData->clipH);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1495
	    if (region == NULL ) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1496
		console_fprintf(stderr, "WinWorkstat [warning]: clipping region creation failed\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1497
	    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1498
		if (SelectClipRgn(hDC, region) == ERROR ) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1499
		    DPRINTF(("WinWorkstat [warning]: select clipping region failed\n" ));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1500
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1501
		_DeleteObject(region, __LINE__);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1502
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1503
	} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1504
	    SelectClipRgn(hDC, NULL);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1505
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1506
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1507
	if (gcData->hFont) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1508
	    HFONT prevFont;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1509
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1510
	    prevFont = SelectObject(hDC, gcData->hFont);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1511
	    if (! gcData->save_hFont) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1512
		gcData->save_hFont = prevFont;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1513
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1514
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1515
    }
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1516
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1517
#ifdef CACHE_LAST_DC
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1518
    lastGcData = gcData;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  1519
    lastGcOwnerThreadID = currThreadId;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1520
    lastGcHWIN = gcData->hWnd;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1521
    lastGcHBITMAP = gcData->hBitmap;
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1522
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1523
    gcData->_hDC = hDC;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1524
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1525
# ifdef CACHE_LAST_WM_PAINT_DC /* DDD */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1526
    if (last_wm_paint_dc == hDC) {
2732
bb3d3b26a81c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2728
diff changeset
  1527
#  ifdef DEBUG_DC_REUSE
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1528
	console_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
  1529
#  endif
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1530
	last_wm_paint_dc = last_wm_paint_win = 0;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1531
    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1532
# endif
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1533
#endif
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1534
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1535
    return hDC;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1536
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1537
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1538
static HBRUSH
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1539
GcDataGetBrush(hDC, gcData)
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1540
    HDC hDC;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1541
    struct gcData *gcData;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1542
{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1543
    HBRUSH hBrush = 0;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1544
    HBRUSH prevBrush;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1545
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1546
#ifdef CACHE_LAST_BRUSH
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1547
    if (hBrush = gcData->hBrush) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1548
	if (! gcData->save_hBrush) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1549
	    gcData->save_hBrush = SelectObject(gcData->_hDC, hBrush);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1550
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1551
	return hBrush;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1552
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1553
#endif
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1554
    if (gcData->hMask) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1555
	hBrush = CreatePatternBrush(gcData->hMask);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1556
	SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1557
	RESPRINTF(("CreatePatternBrush %x\n",gcData->hMask));
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1558
    } else {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1559
	if (gcData->fgColor == BlackPixel) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1560
	    hBrush = __blackBrush;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1561
	} else if (gcData->fgColor == WhitePixel) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1562
	    hBrush = __whiteBrush;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1563
	} else {
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1564
#ifdef CACHE_BRUSH
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1565
	    {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1566
		int i;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1567
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1568
		for (i=0; i<NUM_BRUSH_CACHED; i++) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1569
		    if (__brushCache[i].clr == gcData->fgColor) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1570
			hBrush = __brushCache[i].brush;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1571
			/*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1572
			 * move it up in the cache
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1573
			 */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1574
			if (i > 0) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1575
			    HBRUSH t = __brushCache[i-1].brush;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1576
			    int c = __brushCache[i-1].clr;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1577
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1578
			    __brushCache[i-1].brush = hBrush;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1579
			    __brushCache[i-1].clr = gcData->fgColor;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1580
			    __brushCache[i].brush = t;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1581
			    __brushCache[i].clr = c;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1582
			}
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1583
# ifdef CACHE_LAST_BRUSH
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1584
			prevBrush = SelectObject(gcData->_hDC, hBrush);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1585
			if (! gcData->save_hBrush) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1586
			    gcData->save_hBrush = prevBrush;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1587
			}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1588
			gcData->hBrush = hBrush;
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1589
# endif
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1590
			return hBrush;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1591
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1592
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1593
	    }
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1594
#endif /* BRUSH_CACHE */
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1595
	    hBrush = CreateSolidBrush(gcData->fgColor);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1596
	    RESPRINTF(("CreateSolidBrush %x\n",gcData->fgColor));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1597
	}
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1598
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1599
    gcData->hBrush = hBrush;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1600
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1601
    prevBrush = SelectObject(gcData->_hDC, hBrush);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1602
    if (! gcData->save_hBrush) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1603
	gcData->save_hBrush = prevBrush;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1604
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1605
    return hBrush;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1606
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1607
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1608
#ifdef CACHE_LAST_BRUSH
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1609
# define GcDataReleaseBrush(hDC, gcData)  /* nothing*/
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1610
#else
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1611
static void
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1612
GcDataReleaseBrush(hDC, gcData)
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1613
    HDC hDC;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1614
    struct gcData *gcData;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1615
{
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1616
    HBRUSH hBrush;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1617
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1618
    hBrush = gcData->hBrush;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1619
    if (gcData->save_hBrush) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1620
	SelectObject(hDC, gcData->save_hBrush);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1621
	gcData->save_hBrush = NULL;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1622
    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  1623
    _DeleteBrushIfNotInCache(hBrush, __LINE__);
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1624
    gcData->hBrush = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1625
}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1626
#endif
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1627
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1628
static HPEN
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1629
GcDataGetPen(hDC, gcData)
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1630
    HDC hDC;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1631
    struct gcData *gcData;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1632
{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1633
    HPEN hPen = 0;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1634
    HPEN prevPen;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1635
    LOGBRUSH Brush;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1636
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1637
#ifdef CACHE_LAST_PEN
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1638
    if (hPen = gcData->hPen) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1639
	if (! gcData->save_hPen) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1640
	    gcData->save_hPen = SelectObject(gcData->_hDC, hPen);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1641
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1642
	return hPen;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1643
    }
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1644
#endif
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1645
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1646
    if (((gcData->lStyle & PS_STYLE_MASK) == PS_SOLID)
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1647
     && (gcData->hMask == 0)
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1648
     && (gcData->lineWidth <= 1)) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1649
	if (gcData->fgColor == BlackPixel) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1650
	    gcData->hPen = hPen = __blackPen;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1651
	    prevPen = SelectObject(hDC, hPen);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1652
	    if (! gcData->save_hPen) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1653
		gcData->save_hPen = prevPen;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1654
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1655
	    return hPen;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1656
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1657
	if (gcData->fgColor == WhitePixel) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1658
	    gcData->hPen = hPen = __whitePen;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1659
	    prevPen = SelectObject(hDC, hPen);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1660
	    if (! gcData->save_hPen) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1661
		gcData->save_hPen = prevPen;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1662
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1663
	    return hPen;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1664
	}
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1665
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1666
#ifdef CACHE_PEN
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1667
	{
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1668
	    int i;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1669
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1670
	    for (i=0; i<NUM_PEN_CACHED; i++) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1671
		if (__penCache[i].clr == gcData->fgColor) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1672
		    hPen = __penCache[i].pen;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1673
		    /*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1674
		     * move it up in the cache
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1675
		     */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1676
		    if (i > 0) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1677
			HPEN t = __penCache[i-1].pen;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1678
			int c = __penCache[i-1].clr;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1679
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1680
			__penCache[i-1].pen = hPen;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1681
			__penCache[i-1].clr = gcData->fgColor;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1682
			__penCache[i].pen = t;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1683
			__penCache[i].clr = c;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1684
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1685
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1686
		    gcData->hPen = hPen;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1687
		    prevPen = SelectObject(hDC, hPen);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1688
		    if (! gcData->save_hPen) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1689
			gcData->save_hPen = prevPen;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1690
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1691
		    return hPen;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1692
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1693
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1694
	}
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1695
#endif /* PEN_CACHE */
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1696
    }
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1697
4149
663c31c90a53 optimize displayLine: and define CACHE_LAST_DC
ca
parents: 4145
diff changeset
  1698
    hPen = (HPEN) 0;
663c31c90a53 optimize displayLine: and define CACHE_LAST_DC
ca
parents: 4145
diff changeset
  1699
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1700
    if (__isWinNT) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1701
	int lw = gcData->lineWidth;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1702
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1703
	if (lw == 0) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1704
	    lw = 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1705
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1706
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1707
	/*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1708
	 * NT supports masked drawing with any lineStyle,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1709
	 * and also non-solid lines with any lineWidth.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1710
	 */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1711
	if (gcData->hMask) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1712
	    Brush.lbStyle = BS_PATTERN;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1713
	    Brush.lbHatch = (DWORD)gcData->hMask;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1714
	    Brush.lbColor = gcData->fgColor;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1715
	} else {
4149
663c31c90a53 optimize displayLine: and define CACHE_LAST_DC
ca
parents: 4145
diff changeset
  1716
663c31c90a53 optimize displayLine: and define CACHE_LAST_DC
ca
parents: 4145
diff changeset
  1717
#ifndef PRE_07_APR_04
663c31c90a53 optimize displayLine: and define CACHE_LAST_DC
ca
parents: 4145
diff changeset
  1718
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1719
	    hPen = CreatePen((gcData->lStyle & PS_STYLE_MASK), lw, gcData->fgColor);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1720
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1721
	    RESPRINTF(("CreatePen %x %d(%d) %x %x\n",
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1722
			gcData->lStyle,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1723
			lw, gcData->lineWidth,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1724
			gcData->fgColor, gcData->hMask));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1725
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1726
	    SetBkMode(hDC, TRANSPARENT);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1727
	    gcData->bkMode = BK_TRANSPARENT;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1728
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1729
#else
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1730
	    Brush.lbStyle = BS_SOLID;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1731
	    Brush.lbHatch = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1732
	    Brush.lbColor = gcData->fgColor;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1733
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1734
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1735
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1736
	if (! hPen)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1737
	{
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1738
	    hPen = ExtCreatePen(PS_GEOMETRIC | gcData->lStyle,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1739
			    lw, /* gcData->lineWidth, */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1740
			    &Brush,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1741
			    0, 0);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1742
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1743
	    RESPRINTF(("ExtCreatePen1 %x %d(%d) %x %x\n",
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1744
			gcData->lStyle,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1745
			lw, gcData->lineWidth,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1746
			gcData->fgColor, gcData->hMask));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1747
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1748
	    if (gcData->hMask) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1749
		SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1750
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1751
	}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1752
    } else {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1753
	/*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1754
	 * W95 only supports masked drawing with SOLID lines
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1755
	 * also, we should use COSMETIC pens if possible
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1756
	 * with non-solid lineStyles.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1757
	 */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1758
	if ((gcData->lStyle & PS_STYLE_MASK) == PS_SOLID) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1759
	    int ps = PS_GEOMETRIC;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1760
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1761
	    if (gcData->hMask) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1762
		Brush.lbStyle = BS_PATTERN;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1763
		Brush.lbHatch = (DWORD)gcData->hMask;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1764
		Brush.lbColor = gcData->fgColor;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1765
	    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1766
		Brush.lbStyle = BS_SOLID;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1767
		Brush.lbHatch = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1768
		Brush.lbColor = gcData->fgColor;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1769
		if (gcData->lineWidth <= 1) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1770
		    ps = PS_COSMETIC;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1771
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1772
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1773
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1774
	    hPen = ExtCreatePen(ps | gcData->lStyle,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1775
				gcData->lineWidth,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1776
				&Brush,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1777
				0, 0);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1778
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1779
	    RESPRINTF(("ExtCreatePen1 %x %d %x %x\n",
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1780
			    gcData->lStyle,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1781
			    gcData->lineWidth,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1782
			    gcData->fgColor, gcData->hMask));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1783
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1784
	    if (gcData->hMask) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1785
		SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1786
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1787
	} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1788
	    int lw = gcData->lineWidth;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1789
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1790
	    if (lw == 1) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1791
		lw = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1792
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1793
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1794
	    /*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1795
	     * dashes only supported with lineWidth 0
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1796
	     */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1797
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1798
	    hPen = CreatePen((gcData->lStyle & PS_STYLE_MASK),
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1799
			     lw,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1800
			     gcData->fgColor);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1801
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1802
	    RESPRINTF(("CreatePen %x %d %x\n",
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1803
				(gcData->lStyle & PS_STYLE_MASK),
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1804
				gcData->lineWidth,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1805
				gcData->fgColor));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1806
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1807
	    //
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1808
	    // CG: wrong; must set to opaque, if doubleDashed
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1809
	    //
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1810
	    SetBkMode(hDC, TRANSPARENT);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1811
	    gcData->bkMode = BK_TRANSPARENT;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1812
	}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1813
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1814
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1815
    gcData->hPen = hPen;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1816
    prevPen = SelectObject(hDC, hPen);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1817
    if (! gcData->save_hPen) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1818
	gcData->save_hPen = prevPen;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1819
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1820
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1821
#ifdef CACHE_PEN
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1822
    /*
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1823
     * remember in penCache
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1824
     */
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1825
    if (((gcData->lStyle & PS_STYLE_MASK) == PS_SOLID)
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1826
     && (gcData->hMask == 0)
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1827
     && (gcData->lineWidth <= 1)) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1828
	int i;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1829
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1830
	/*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1831
	 * search for an empty slot
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1832
	 */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1833
	for (i=0; i<NUM_PEN_CACHED; i++) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1834
	    if (__penCache[i].pen == 0) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1835
		__penCache[i].clr = gcData->fgColor;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1836
		__penCache[i].pen = hPen;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1837
		break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1838
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1839
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1840
	if (i == NUM_PEN_CACHED) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1841
	    /*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1842
	     * replace last in penCache
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1843
	     */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1844
	    HPEN t = __penCache[NUM_PEN_CACHED - 1].pen;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1845
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1846
	    __penCache[NUM_PEN_CACHED - 1].pen = hPen;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1847
	    __penCache[NUM_PEN_CACHED - 1].clr = gcData->fgColor;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1848
	    _DeletePen(t, __LINE__);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1849
	}
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1850
    }
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1851
#endif
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1852
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1853
    return hPen;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1854
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1855
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1856
#ifdef CACHE_LAST_PEN
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1857
# define GcDataReleasePen(hDC, gcData)  /* nothing*/
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1858
#else
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1859
static void
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1860
GcDataReleasePen(hDC, gcData)
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1861
    HDC hDC;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1862
    struct gcData *gcData;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1863
{
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1864
    HPEN hPen;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1865
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1866
    if (gcData->save_hPen) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1867
	SelectObject(hDC, gcData->save_hPen);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1868
	gcData->save_hPen = NULL;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1869
    }
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1870
    hPen = gcData->hPen;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  1871
    _DeletePenIfNotInCache(hPen, __LINE__);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1872
    gcData->hPen = 0;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1873
}
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1874
#endif /* CACHE_LAST_PEN */
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1875
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1876
/* atze */
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1877
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1878
static int
4367
0486a7345d7f *** empty log message ***
penk
parents: 4366
diff changeset
  1879
lockEvents(whoIsLocking)
0486a7345d7f *** empty log message ***
penk
parents: 4366
diff changeset
  1880
    char *whoIsLocking;
0486a7345d7f *** empty log message ***
penk
parents: 4366
diff changeset
  1881
{
4504
0f0a6f7fabd5 lockEvent bug (workaround ?)
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1882
    DWORD dwWaitResult = WaitForSingleObject(hEventsMutex, 5000L);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1883
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1884
#ifdef LOCK_DEBUG
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1885
    lockCountEvents++;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1886
    if (lockCountEvents != 1) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1887
	console_fprintf(stderr, "WinWorkstation [warning]: lockCountEvents (%d) != 1 in lock\n", lockCountEvents);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1888
	lockCountEvents = 1;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1889
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1890
#endif
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1891
4504
0f0a6f7fabd5 lockEvent bug (workaround ?)
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1892
    switch (dwWaitResult) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1893
	case WAIT_OBJECT_0:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1894
	    hEventsMutexOwner = whoIsLocking;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1895
	    return (TRUE);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1896
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1897
	case WAIT_ABANDONED:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1898
	    console_fprintf(stderr, "WinWorkstation [warning]: lockEvent abandoned (was owned by %s)\n",
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1899
			(hEventsMutexOwner ? hEventsMutexOwner : "NONE"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1900
	    hEventsMutexOwner = whoIsLocking;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1901
	    return (TRUE);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1902
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1903
	case WAIT_TIMEOUT:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1904
	    console_fprintf(stderr, "WinWorkstation [warning]: lockEvent timeout (owned by %s)\n",
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1905
			(hEventsMutexOwner ? hEventsMutexOwner : "NONE") );
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1906
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1907
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1908
	default:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1909
	    {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1910
		unsigned errCode = GetLastError();
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1911
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1912
		console_fprintf(stderr, "WinWorkstation [error]: lockEvent error (owned by %s) rslt=0x%x err=0x%x\n",
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1913
			    (hEventsMutexOwner ? hEventsMutexOwner : "NONE"),
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1914
			    dwWaitResult, errCode );
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1915
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1916
	    break;
4504
0f0a6f7fabd5 lockEvent bug (workaround ?)
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1917
    }
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1918
    return (FALSE);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1919
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1920
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1921
static int
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1922
unlockEvents() {
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1923
#ifdef LOCK_DEBUG
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1924
    lockCountEvents--;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1925
    if (lockCountEvents != 0) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1926
	console_fprintf(stderr, "WinWorkstation [warning]: lockCountEvents (%d) != 0 in unlock\n", lockCountEvents);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1927
	lockCountEvents = 0;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1928
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1929
#endif
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1930
    if (! ReleaseMutex(hEventsMutex)) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  1931
       console_fprintf(stderr, "WinWorkstation [error]: unlockEvent error\n");
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1932
       return (FALSE);
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1933
    }
4504
0f0a6f7fabd5 lockEvent bug (workaround ?)
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1934
    hEventsMutexOwner = NULL;
4367
0486a7345d7f *** empty log message ***
penk
parents: 4366
diff changeset
  1935
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1936
    return (TRUE);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1937
}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1938
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1939
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1940
static int
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1941
initEventqueue() {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1942
    struct queuedEvent *bulk;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1943
    int i;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1944
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1945
    bulk = (struct queuedEvent *) malloc(EV_CHUNK_SZ);
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1946
    if (bulk == 0) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1947
	console_fprintf(stderr, "WinWorkstation [warning]: no memory for dispatchqueue\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1948
	return 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1949
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1950
    for (i=1; i<EV_CHUNK_CNT; i++) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1951
	bulk[i-1].ev_next = &(bulk[i]);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1952
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1953
    bulk[EV_CHUNK_CNT-1].ev_next = (struct queuedEvent *)0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1954
    eventFreeList = bulk;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1955
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1956
    return 1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1957
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1958
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  1959
#define EV_NOTIME       0
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  1960
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1961
#define enqEvent(a1, a2, a3, a4, a5, a6, a7, a8, a9) \
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1962
    __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
  1963
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1964
static void
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1965
__enqEvent(flag, hWnd, message, wParam, arg1, arg2, arg3, arg4, evTime)
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1966
    HWND hWnd;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1967
    UINT message;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1968
    UINT wParam;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  1969
    UINT evTime;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1970
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1971
    struct queuedEvent *ev = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1972
    int repeatCount = 0;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1973
4445
c83f9aebaf41 comment
Claus Gittinger <cg@exept.de>
parents: 4444
diff changeset
  1974
    /* get an event struct
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1975
    */
4445
c83f9aebaf41 comment
Claus Gittinger <cg@exept.de>
parents: 4444
diff changeset
  1976
    while (! eventFreeList) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1977
	if (repeatCount++ >= 5) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1978
	    /* throw away sorry */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1979
	    console_fprintf(stderr, "WinWorkstation [error]: event throw away (memory problem)\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1980
	    return;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1981
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1982
	console_fprintf(stderr, "WinWorkstation [warning]: wait for event memory (%d)\n", repeatCount);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1983
	WaitForSingleObject( hNeverTriggered, 100L );
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1984
    }
4367
0486a7345d7f *** empty log message ***
penk
parents: 4366
diff changeset
  1985
    if (! lockEvents("enqEvent")) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1986
	console_fprintf(stderr, "WinWorkstation [error]: event throw away (lock problem)\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1987
	return;
4363
d7a017ae1487 *** empty log message ***
penk
parents: 4353
diff changeset
  1988
    }
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1989
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1990
    ev = eventFreeList;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1991
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1992
    if (! ev) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1993
	console_fprintf(stderr, "WinWorkstation [error]: event throw away (memory problem)\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1994
	unlockEvents();
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  1995
	return;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1996
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1997
    eventFreeList  = ev->ev_next;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1998
    ev->ev_flag    = flag;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1999
    ev->ev_hWnd    = hWnd;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  2000
    ev->ev_message = message;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2001
    ev->ev_wParam  = wParam;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2002
    ev->ev_arg1    = arg1;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2003
    ev->ev_arg2    = arg2;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2004
    ev->ev_arg3    = arg3;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2005
    ev->ev_arg4    = arg4;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2006
    ev->ev_time    = evTime /* lastMSGTime */;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2007
    ev->count      = eventsendcount++;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2008
    ev->ev_next    = (struct queuedEvent *) 0;
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  2009
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  2010
    if (eventQueueTail) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2011
	eventQueueTail->ev_next = ev;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  2012
    } else {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2013
	eventQueueHead = ev;
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  2014
    }
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  2015
    eventQueueTail = ev;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2016
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2017
    unlockEvents();
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2018
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2019
    if (eventQueueHead == ev) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2020
	SetEvent(hInputEvent);
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  2021
    }
2511
5795501d41cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2508
diff changeset
  2022
2337
79f957096b99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2336
diff changeset
  2023
#if 0
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2024
    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
  2025
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2026
}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2027
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2028
static int
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2029
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
  2030
{
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2031
    struct queuedEvent * ev = NULL;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2032
    char * freeArg2 = NULL;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2033
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2034
    if (mask != ~0) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2035
	PRINTF(("deqEvent mask:%x\n",mask));
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2036
    }
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2037
    if (hWnd) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2038
	PRINTF(("deqEvent hWnd:%x\n",hWnd));
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2039
    }
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2040
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2041
  again:
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2042
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2043
    if (! eventQueueHead)
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2044
	return (0);
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2045
4367
0486a7345d7f *** empty log message ***
penk
parents: 4366
diff changeset
  2046
    if (! lockEvents("deqEvent")) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2047
	return (0);
4363
d7a017ae1487 *** empty log message ***
penk
parents: 4353
diff changeset
  2048
    }
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2049
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2050
    TH_DPRINTF(("TDEQ\n"));
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2051
    ev = eventQueueHead;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2052
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2053
    if (! ev) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2054
	unlockEvents();
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2055
	return (0);
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2056
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2057
    eventQueueHead = ev->ev_next;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2058
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2059
    if (! eventQueueHead) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2060
	eventQueueTail = (struct queuedEvent *) 0;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2061
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2062
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2063
    if (ev->count != -1) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2064
	static int anyGoodEventReceived = 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2065
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2066
	if (eventempfcount != ev->count) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2067
	    if (anyGoodEventReceived) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2068
		console_fprintf(stderr, "WinWorkstation [warning]: lost event (eventcount error %d <-> %d)\n",
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2069
				 eventempfcount, ev->count);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2070
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2071
	    eventempfcount = ev->count;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2072
	    anyGoodEventReceived = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2073
	} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2074
	    anyGoodEventReceived = 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2075
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2076
	eventempfcount++;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2077
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2078
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2079
    if (ev->ev_message == WM_DESTROY) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2080
	/*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2081
	 * arg2 is the localInfoPtr
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2082
	 * (which is already cleared in the wind-structure)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2083
	 * it must be freed by the stx-process ('cause it was malloc'd by it)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2084
	 */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2085
	if (ev->ev_arg2) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2086
	    freeArg2 = (char *) ev->ev_arg2;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2087
	    ev->ev_arg2 = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2088
	}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2089
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2090
#ifdef TOPWINDOWCLASS
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2091
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2092
FALSCH: nochmals in QUEUE -> (ev_arg2 != 0) arg2 freed !!!
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2093
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2094
	if (ev->ev_arg1) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2095
	    if (UnregisterClass((char*)ev->ev_arg1,(HANDLE) __getHInstance())) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2096
		/*console_printf("UnregisterClass %s ok.\n",(char*)ev->ev_arg1);*/
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2097
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2098
	    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2099
		/* noch einmal in die queue
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2100
		*/
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2101
		if (ev->ev_arg2++ < 100) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2102
		    ev->ev_next = (struct queuedEvent *)0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2103
		    ev->count   = eventsendcount++;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2104
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2105
		    if (eventQueueTail) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2106
			eventQueueTail->ev_next = ev;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2107
		    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2108
			eventQueueHead = ev;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2109
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2110
		    eventQueueTail = ev;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2111
		    unlockEvents();
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2112
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2113
		    if (freeArg2) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2114
			free (freeArg2);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2115
			freeArg2 = NULL;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2116
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2117
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2118
		    if (ev->ev_arg2 > 98) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2119
			console_fprintf(stderr, "WinWorkstation [info]: UnregisterClass %s failed. Wait 1 sec.\n",(char*)ev->ev_arg1);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2120
			sleep(1);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2121
		    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2122
			sleep(0);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2123
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2124
		    goto again;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2125
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2126
		/* fail evtl. später ändern und in st verzögert aufrufen
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2127
		*/
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2128
		console_fprintf(stderr, "WinWorkstation [info]: UnregisterClass %s failed.\n",(char*)ev->ev_arg1);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2129
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2130
	    free((char*)ev->ev_arg1);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2131
	    ev->ev_arg1 = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2132
	}
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2133
#endif
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2134
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2135
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2136
    *ret_ev = *ev;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2137
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2138
    ev->ev_next   = eventFreeList;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2139
    eventFreeList = ev;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2140
    unlockEvents();
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2141
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2142
    if (freeArg2) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2143
	free (freeArg2);
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2144
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2145
    return (1);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2146
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2147
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2148
static void
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2149
__clearRectangles(hWnd, numRects, pRect)
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2150
    HWND hWnd;
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2151
    RECT *pRect;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2152
{
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2153
	HDC dc;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2154
	HBRUSH br;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2155
	int bgClr;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2156
	int isPrivateBrush = 0;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2157
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2158
# ifdef CACHE_LAST_WM_PAINT_DC
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2159
	AQUIRE_PAINT_MUTEX;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2160
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2161
	if (last_wm_paint_dc && (last_wm_paint_win == hWnd)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2162
	    dc = last_wm_paint_dc;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2163
	} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2164
	    if (last_wm_paint_dc) {
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2165
#  ifdef CACHE_LAST_DC
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2166
		if (lastGcData && (lastGcData->_hDC == last_wm_paint_dc)) {
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2167
#   ifdef DEBUG_DC_REUSE
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2168
		    console_fprintf(stderr, "WinWorkstation [info]: Oops - release lastGcData [%d]\n", __LINE__);
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2169
#   endif
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2170
		    _releaseDC(lastGcData);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2171
		} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2172
		    ReleaseDC(last_wm_paint_win, last_wm_paint_dc);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2173
		}
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2174
#  else
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2175
		ReleaseDC(last_wm_paint_win, last_wm_paint_dc);
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  2176
#  endif /* CACHE_LAST_DC */
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2177
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2178
	    dc = GetDC(hWnd);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2179
	    last_wm_paint_dc = dc;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2180
	    last_wm_paint_win = hWnd;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2181
	}
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2182
# else
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2183
	dc = (HDC)GetDC(hWnd);
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  2184
# endif /* CACHE_LAST_WM_PAINT_DC */
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2185
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2186
# ifdef CACHE_LAST_DC
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2187
	if (lastGcData && (lastGcData->_hDC == dc)) {
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2188
#  ifdef DEBUG_DC_REUSE
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2189
	    console_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
  2190
#  endif
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2191
	    if ((lastGcData->rop2 != R2_COPYPEN)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2192
	     || (lastGcData->bitbltrop2 != BITBLT_COPY)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2193
		console_fprintf(stderr, "WinWorkstation [info]: Oops wm_paint_dc not in Copy mode\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2194
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2195
	    lastGcData = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2196
	}
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2197
# endif
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2198
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2199
	br = GetWindow_viewBgBrush(hWnd);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2200
	if (! br) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2201
	    bgClr = GetWindow_viewBgColor(hWnd);
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2202
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2203
# ifdef CACHE_LAST_WM_PAINT_BRUSH
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2204
	    if (last_wm_paint_brush
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2205
	     && (last_wm_paint_brush_clr == bgClr)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2206
		br = last_wm_paint_brush;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2207
	    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2208
		if (bgClr == WhitePixel) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2209
		    br = __whiteBrush;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2210
		} else if (bgClr == BlackPixel) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2211
		    br = __blackBrush;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2212
		} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2213
		    if (last_wm_paint_brush) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2214
			_DeleteBrush(last_wm_paint_brush, __LINE__);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2215
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2216
		    last_wm_paint_brush = br = CreateSolidBrush(bgClr);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2217
		    last_wm_paint_brush_clr = bgClr;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2218
		    isPrivateBrush = 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2219
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2220
	    }
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2221
# else
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2222
	    br = CreateSolidBrush(bgClr);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2223
	    isPrivateBrush = 1;
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2224
# endif
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2225
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2226
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2227
	if (! br) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2228
	    console_fprintf(stderr, "WinWorkstation [info]: no brush\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2229
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2230
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2231
	if (br) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2232
	    int i;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2233
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2234
	    SelectClipRgn(dc, NULL);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2235
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2236
	    for (i=0; i<numRects; i++) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2237
		/*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2238
		 * always clear - even if not interested in exposes
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2239
		 */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2240
		FillRect(dc, &(pRect[i]), br);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2241
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2242
	}
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2243
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2244
# ifndef CACHE_LAST_WM_PAINT_BRUSH
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2245
	if (isPrivateBrush) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2246
	    _DeleteBrush(br, __LINE__);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2247
	}
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2248
# endif
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2249
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2250
# ifndef CACHE_LAST_WM_PAINT_DC
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2251
	ReleaseDC(hWnd, dc);
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2252
# endif
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2253
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  2254
# if defined(CACHE_LAST_WM_PAINT_DC)
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2255
	RELEASE_PAINT_MUTEX
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2256
# endif
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2257
}
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2258
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2259
static void
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2260
__clearWindow(hWnd, x, y, w, h)
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2261
    HWND hWnd;
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2262
{
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2263
	RECT rect;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2264
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2265
	rect.left = x;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2266
	rect.top = y;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2267
	rect.right = x + w;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2268
	rect.bottom = y + h;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2269
	__clearRectangles(hWnd, 1, &rect);
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2270
}
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2271
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2272
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2273
/*
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2274
 * 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
  2275
 * return the number of events (>0), if any was generated.
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2276
 * 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
  2277
 * if a region is passed in, it is not destroyed.
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2278
 */
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2279
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2280
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2281
static int
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  2282
__generateExposes(hWnd, hRgnInOrNull, msgType, doClear)
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2283
    HWND hWnd;
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2284
    int msgType;
2700
3156d7e1efd6 fixed scroll-update for win32
Claus Gittinger <cg@exept.de>
parents: 2698
diff changeset
  2285
    HRGN hRgnInOrNull;
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2286
{
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2287
	RECT updRect;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2288
	HRGN updRgn = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2289
	int numRects, ret, n, i;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2290
	int wantExpose;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2291
	RECT *pRect;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2292
	union {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2293
	    RGNDATA rgnData;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2294
	    char    bytes[512];
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2295
	} data;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2296
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2297
	wantExpose = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2298
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2299
	if( msgType >= 0 )
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2300
	    wantExpose = (GetWindow_eventMask(hWnd) & ExposureMask);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2301
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2302
	if (hRgnInOrNull) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2303
	    updRgn = hRgnInOrNull;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2304
	} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2305
	    PAINTSTRUCT ps;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2306
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2307
	    /*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2308
	     * fetch the update region, even if ExposureMask is empty.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2309
	     */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2310
	    updRgn = CreateRectRgn(0, 0, 0, 0);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2311
	    ret = GetUpdateRgn(hWnd, updRgn, FALSE);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2312
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2313
#if 0
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2314
	    BeginPaint(hWnd, &ps);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2315
	    /* store the rectangle required for image bit reversal */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2316
	    /* updateRect = ps.rcPaint;   */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2317
	    EndPaint(hWnd, &ps);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2318
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2319
	    switch (ret) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2320
		case ERROR:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2321
		    console_fprintf(stderr, "WinWorkstation [info]: errregion\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2322
		    return -1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2323
		case NULLREGION:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2324
		    DDPRINTF(("nullregion\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2325
		    _DeleteObject(updRgn, __LINE__);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2326
		    return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2327
		case SIMPLEREGION:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2328
		case COMPLEXREGION:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2329
		    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2330
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2331
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2332
	n = GetRegionData(updRgn, sizeof(data), &(data.rgnData));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2333
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2334
	/*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2335
	 * the MS-doc states: n==1
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2336
	 * but this is not true
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2337
	 */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2338
	if ((n >= sizeof(RGNDATA))
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2339
	 && (n <= sizeof(data))
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2340
	 && (data.rgnData.rdh.iType == RDH_RECTANGLES))  {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2341
	    /* ok, got the region */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2342
	    numRects = data.rgnData.rdh.nCount;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2343
	    pRect = (RECT *)(data.rgnData.Buffer);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2344
	    DDPRINTF(("region numRects=%d\n", numRects));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2345
	} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2346
	    /* a big region ... */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2347
	    GetRgnBox(updRgn, &updRect);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2348
	    numRects = 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2349
	    pRect = &updRect;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2350
	    DPRINTF(("very complex region (need:%d have:%d) bounds=%d,%d -> %d,%d\n",
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2351
		     n, sizeof(data),
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2352
		     updRect.left, updRect.top,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2353
		     updRect.right, updRect.bottom));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2354
	    if (((updRect.right - updRect.left) <= 0)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2355
	     || ((updRect.bottom - updRect.top) <= 0)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2356
		numRects = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2357
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2358
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2359
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2360
	if (numRects) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2361
	    if (doClear) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2362
		__clearRectangles(hWnd, numRects, pRect);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2363
	    }
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  2364
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  2365
#ifndef PRE_21_NOV
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2366
	for (i=0; i < numRects; i++) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2367
	    ValidateRect( hWnd, &pRect[i] );
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2368
	}
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2369
#endif
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2370
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2371
#ifdef DEBUG_COLORIZE_WM_PAINT_RECTS1
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2372
	    {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2373
		HDC hDC;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2374
		HBRUSH hBrush;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2375
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2376
		hBrush = CreateSolidBrush(BlackPixel);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2377
		hDC = GetWindowDC(hWnd);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2378
		SelectClipRgn(hDC, NULL);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2379
		for (i=0; i<numRects; i++) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2380
		    FillRect(hDC, &(pRect[i]), hBrush);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2381
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2382
		_DeleteBrush(hBrush, __LINE__);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2383
		ReleaseDC(hWnd, hDC);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2384
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2385
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2386
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2387
	    if (wantExpose) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2388
		for (i=0; i<numRects; i++) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2389
		    int final = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2390
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2391
		    if ((msgType == __WM_GEXPOSE)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2392
		     && (i == (numRects - 1))) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2393
			final = 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2394
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2395
		    enqEvent(ExposureMask, hWnd, msgType, final,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2396
			     pRect[i].left, pRect[i].top,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2397
			     pRect[i].right - pRect[i].left,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2398
			     pRect[i].bottom - pRect[i].top,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2399
			     EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2400
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2401
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2402
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2403
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2404
	if (updRgn && (updRgn != hRgnInOrNull)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2405
	    _DeleteObject(updRgn, __LINE__);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2406
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2407
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2408
	return numRects;
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2409
}
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2410
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2411
#ifdef THIS_DOES_NOT_AVOID_DOUBLE_REPAINTS
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2412
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2413
BOOL CALLBACK recursiveExposeGenerator(hChild, param)
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2414
    HWND hChild;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2415
    LPARAM param;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2416
{
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2417
	__generateExposes(hChild, NULL, param, 0);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2418
	return TRUE;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2419
}
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2420
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2421
static void
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2422
__generateRecursiveExposes(hWnd, msgType)
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2423
    HWND hWnd;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2424
{
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2425
	EnumChildWindows(hWnd, recursiveExposeGenerator, msgType);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2426
}
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2427
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2428
#endif /* sigh */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2429
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2430
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2431
static
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2432
getModifiers()
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2433
{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2434
    int modifiers = 0;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2435
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2436
    if (GetKeyState(VK_SHIFT) & 0x8000)
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2437
	modifiers |= ShiftMask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2438
    if (GetKeyState(VK_CONTROL) & 0x8000)
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2439
	modifiers |= ControlMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2440
#if 0
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2441
    if (GetKeyState(VK_RMENU) & 0x8000)
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2442
	modifiers |= RightAltMask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2443
    if (GetKeyState(VK_LMENU) & 0x8000)
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2444
	modifiers |= LeftAltMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2445
#else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2446
    if (GetKeyState(VK_MENU) & 0x8000)
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2447
	modifiers |= LeftAltMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2448
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2449
    if (GetKeyState(VK_LBUTTON) & 0x8000)
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2450
	modifiers |= Button1Mask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2451
    if (GetKeyState(VK_MBUTTON) & 0x8000)
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2452
	modifiers |= Button2Mask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2453
    if (GetKeyState(VK_RBUTTON) & 0x8000)
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2454
	modifiers |= Button3Mask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2455
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  2456
    if ((modifiers & AnyButtonMask) == 0) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2457
	__eatingMouseEvents = 0;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  2458
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2459
    return modifiers;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2460
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2461
4132
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2462
#ifndef PRE_01_APR_04
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2463
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2464
/* test whether a button is pressed but we think no button was pressed;
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2465
   in this case 0 (false) is returned otherwise true
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2466
*/
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2467
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2468
# define MustHandleButtonEvent()\
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2469
    (((__currentCapture == CAPTURE_NONE)       \
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2470
     && (   (GetKeyState(VK_LBUTTON) & 0x8000) \
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2471
	 || (GetKeyState(VK_MBUTTON) & 0x8000) \
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2472
	 || (GetKeyState(VK_RBUTTON) & 0x8000) \
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2473
	)                                      \
4132
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2474
    ) ? 0 : 1)
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2475
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2476
#else
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2477
# define MustHandleButtonEvent()   1
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2478
#endif
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2479
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2480
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2481
#ifdef HANDLE_VIEWGRAVITY
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2482
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2483
struct gravityCallBackInfo {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2484
    HWND parent;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2485
    int  currW, currH;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2486
    int  newW, newH;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2487
    int  parentWinX, parentWinY;
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
static BOOL CALLBACK
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2491
gravityEnumeratorCallBack(hChild, iP)
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2492
    HWND hChild;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2493
    struct gravityCallBackInfo *iP;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2494
{
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2495
    localWindowInfo *lI;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2496
    int gravity;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2497
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2498
    if (lI = GETLOCALWINDOWINFOPTR(hChild)) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2499
	if ((gravity = lI->viewGravity) != GRAVITY_NONE) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2500
	    RECT oldChildRct, oldChildWinRct;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2501
	    RECT newChildRct;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2502
	    int deltaW, deltaH;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2503
	    int anyChange = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2504
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2505
	    /*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2506
	     * get its current bounds ...
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2507
	     */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2508
	    GetClientRect(hChild, &oldChildRct);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2509
	    deltaW = iP->newW - iP->currW;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2510
	    deltaH = iP->newH - iP->currH;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2511
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2512
	    GetWindowRect(hChild, &oldChildWinRct);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2513
	    oldChildRct.left = oldChildWinRct.left - iP->parentWinX;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2514
	    oldChildRct.top =  oldChildWinRct.top - iP->parentWinY;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2515
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2516
	    newChildRct = oldChildRct;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2517
	    switch (gravity) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2518
#if 0
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2519
		case GRAVITY_N:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2520
		    console_fprintf(stderr, "WinWorkstation [info]: Child %x: North gravity\n", hChild);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2521
		    /*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2522
		     * shift to the bottom, for a constant
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2523
		     * distance from the bottom edge;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2524
		     */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2525
		    newChildRct.bottom += deltaH;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2526
		    anyChange = 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2527
		    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2528
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2529
		case GRAVITY_W:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2530
		    console_fprintf(stderr, "WinWorkstation [info]: Child %x: West gravity\n", hChild);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2531
		    /*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2532
		     * shift to the right, for a constant
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2533
		     * distance from the right edge;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2534
		     */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2535
		    newChildRct.right += deltaW;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2536
		    anyChange = 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2537
		    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2538
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2539
		case GRAVITY_S:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2540
		    console_fprintf(stderr, "WinWorkstation [info]: Child %x: South gravity\n", hChild);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2541
		    /*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2542
		     * shift to the bottom, for a constant
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2543
		     * distance from the bottom edge;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2544
		     */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2545
		    newChildRct.top += deltaH;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2546
		    newChildRct.bottom  += deltaH;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2547
		    anyChange = 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2548
		    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2549
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2550
		case GRAVITY_E:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2551
		    console_fprintf(stderr, "WinWorkstation [info]: Child %x: East gravity\n", hChild);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2552
		    /*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2553
		     * shift to the right, for a constant
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2554
		     * distance from the right edge;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2555
		     */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2556
		    newChildRct.right += deltaW;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2557
		    newChildRct.left  += deltaW;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2558
		    anyChange = 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2559
		    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2560
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2561
		case GRAVITY_SE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2562
		    console_fprintf(stderr, "WinWorkstation [info]: Child %x: SouthEast gravity\n", hChild);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2563
		    /*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2564
		     * shift to the bottom-right, for a constant
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2565
		     * distance from the bottom-right edge;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2566
		     */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2567
		    newChildRct.right += deltaW;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2568
		    newChildRct.left  += deltaW;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2569
		    newChildRct.top += deltaH;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2570
		    newChildRct.bottom  += deltaH;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2571
		    anyChange = 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2572
		    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2573
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2574
		default:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2575
		    DPRINTF(("Child %x: other gravity\n", hChild));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2576
		    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2577
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2578
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2579
	    if (anyChange) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2580
		if ((newChildRct.left < 0)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2581
		 || (newChildRct.top < 0)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2582
		 || (newChildRct.right >= iP->newW)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2583
		 || (newChildRct.bottom >= iP->newH)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2584
		    console_fprintf(stderr, "WinWorkstation [info]: dont move child to: %d/%d -> %d/%d\n",
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2585
				    newChildRct.left, newChildRct.top,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2586
				    newChildRct.right, newChildRct.bottom);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2587
		} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2588
		    console_fprintf(stderr, "WinWorkstation [info]: move child from %d/%d->%d/%d to: %d/%d->%d/%d\n",
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2589
				    oldChildRct.left, oldChildRct.top,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2590
				    oldChildRct.right, oldChildRct.bottom,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2591
				    newChildRct.left, newChildRct.top,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2592
				    newChildRct.right, newChildRct.bottom);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2593
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2594
		    SetWindowPos(hChild, (HWND)0,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2595
				 newChildRct.left, newChildRct.top,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2596
				 0, 0,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2597
				 /* SWP_NOSENDCHANGING | */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2598
				 SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2599
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2600
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2601
	}
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2602
    }
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2603
    return TRUE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2604
}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2605
#endif /* HANDLE_VIEWGRAVITY */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2606
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2607
static void
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2608
ch2wch(char *in, wchar_t *out, int nMax)
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2609
{
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2610
    unsigned char *cp = (unsigned char *)in;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2611
    wchar_t *wcp = out;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2612
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2613
    while ((nMax > 1) && cp && *cp) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2614
	*wcp++ = *cp++;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2615
	nMax--;
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2616
    }
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2617
    *wcp = 0;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2618
}
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2619
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2620
static int
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2621
winEventProcessing(hWnd, message, wParam, lParam, pDefault)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2622
    HWND hWnd;                /* window handle                   */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2623
    UINT message;             /* type of message                 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2624
    UINT wParam;              /* additional information          */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2625
    LONG lParam;              /* additional information          */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2626
    int *pDefault;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2627
{
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2628
    int curButton;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2629
    int x, y, w, h;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2630
    int isNative = 0;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2631
    UINT evTime;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2632
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2633
    /* kludge - info is in msg-struct,
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2634
     * but lost here. (slightly inexact ... but who cares)
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2635
     */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2636
    evTime = lastMSGTime;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2637
    lastMSGTime = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2638
    if (evTime == 0) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2639
	lastMSGTime = GetTickCount();
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2640
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2641
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2642
/*
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2643
    EVENT_PRINTF(("winEvent hWin=0x%x message=0x%x wP=0x%x lP=0x%x\n",
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2644
			hWnd, message, wParam, lParam));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2645
*/
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2646
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  2647
    if (hWnd) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2648
	if (message != WM_MOUSEMOVE) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2649
	    lastMotionWnd = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2650
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2651
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2652
	isNative = (GetWindow_flag(hWnd) & LI_NATIVEWIN);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2653
	if (isNative) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2654
	    NDPRINTF(("event %d (0x%x) for nativeWindow\n", message, message));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2655
	}
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  2656
    }
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  2657
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2658
    /*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2659
     * messages which are enqueued to be handled by the view thread
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2660
     */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2661
    switch (message) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2662
	case WM_THREAD_CREATEWINDOW:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2663
	    EVENT_PRINTF(("*WM_THREAD_CREATEWINDOW\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2664
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2665
	    {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2666
		createWindowInfo *cwi = (createWindowInfo *)(lParam);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2667
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2668
		if ((cwi->sequenceNr == wParam)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2669
		 && (cwi->sequenceNr != INVALIDATED_CWI)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2670
		    cwi->sequenceNr = INVALIDATED_CWI;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2671
		    cwi->infoWasRead = 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2672
		    if (cwi->newWinHandle == NULL) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2673
			HANDLE ev;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2674
			HANDLE hwnd;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2675
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2676
			cwi->newWinHandle = hwnd = CreateWindowExW(
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2677
					    cwi->winStyleBitsEx,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2678
					    cwi->className,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2679
					    cwi->windowName,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2680
					    cwi->winStyleBits,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2681
					    cwi->x, cwi->y,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2682
					    cwi->dx, cwi->dy,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2683
					    cwi->parentHandle,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2684
					    NULL,           /* menu */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2685
					    (HANDLE) __getHInstance(),
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2686
					    cwi->localWindowInfo
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2687
					   );
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2688
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2689
			if (hwnd == NULL) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2690
			    cwi->errCode = GetLastError();
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2691
			    console_fprintf(stderr, "WinWorkstation [info]: CreateWindow failed: %d (0x%x) [%d]\n",
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2692
						cwi->errCode, cwi->errCode, __LINE__);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2693
			} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2694
			    SETLOCALWINDOWINFOPTR(hwnd, cwi->localWindowInfo);
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  2695
#ifdef DEBUG /* PARANOIA */
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2696
			    if (GETLOCALWINDOWINFOPTR(hwnd) != cwi->localWindowInfo) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2697
			       console_fprintf(stderr, "lI-Error\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2698
			    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2699
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2700
			    SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2701
					/* SWP_NOOWNERZORDER |*/
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2702
					SWP_NOSENDCHANGING | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2703
			}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2704
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2705
			ev = cwi->hCreateEvent;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2706
			if (ev) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2707
			    SetEvent(ev);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2708
			}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2709
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2710
		} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2711
		    DPRINTF(("obsolete createWindow message %x ignored\n", cwi->sequenceNr));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2712
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2713
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2714
	    *pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2715
	    return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2716
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2717
	case WM_THREAD_DESTROYWINDOW:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2718
	    {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2719
		HBRUSH br;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2720
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2721
		br = GetWindow_viewBgBrush(hWnd);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2722
		if (br) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2723
		    SetWindow_viewBgBrush(hWnd, 0);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2724
		    _DeleteBrushIfNotInCache(br, __LINE__);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2725
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2726
	    }
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2727
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2728
#ifdef CACHE_LAST_DC
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2729
	    if (lastGcData && (lastGcHWIN == hWnd)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2730
		_releaseDC(lastGcData);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2731
	    }
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2732
#endif
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  2733
#ifdef CACHE_LAST_WM_PAINT_DC
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2734
	    if (last_wm_paint_dc && (last_wm_paint_win == hWnd)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2735
		ReleaseDC(hWnd, last_wm_paint_dc);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2736
		last_wm_paint_win = last_wm_paint_dc = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2737
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2738
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2739
	    if (! DestroyWindow(hWnd)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2740
		DPRINTF(("DestroyWindow ERROR\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2741
	    } else {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2742
#ifdef COUNT_RESOURCES
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2743
		__cnt_createWindows--;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2744
		RESPRINTF(("DestroyWindow -> %d\n", __cnt_createWindows));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2745
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2746
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2747
	    *pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2748
	    return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2749
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2750
	case WM_CREATE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2751
	    {
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  2752
#ifdef SETLOCALINFO_IN_CREATE /* no longer */
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2753
		localWindowInfo *lI;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2754
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2755
		CREATESTRUCT *lpcs = (LPCREATESTRUCT) lParam; // structure with creation data
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2756
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2757
		lI = lpcs->lpCreateParams;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2758
		EVENT_PRINTF(("WM_CREATE lI=%x\n", lI));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2759
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2760
		SETLOCALWINDOWINFOPTR(hWnd, lI);
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  2761
# ifdef SUPERDEBUG
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2762
		if (GETLOCALWINDOWINFOPTR(hWnd) != lpcs->lpCreateParams) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2763
		    PRINTF(("SETLOCALWINDOWINFOPTR ERROR\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2764
		}
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  2765
# endif /* SUPERDEBUG */
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  2766
#endif
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  2767
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2768
		*pDefault = 0;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2769
#ifdef COUNT_RESOURCES
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2770
		__cnt_createWindows++;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2771
		RESPRINTF(("CreateWindows %d\n",__cnt_createWindows));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2772
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2773
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2774
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2775
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2776
	case WM_CLOSE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2777
	    EVENT_PRINTF(("WM_CLOSE\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2778
	    if (! destroyWin) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2779
		// (flag, hWnd, message, wParam, arg1, arg2, arg3, arg4, evTime)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2780
		enqEvent(0, hWnd, WM_CLOSE, wParam, 0, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2781
	    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2782
		destroyWin = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2783
		{
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2784
		    HBRUSH br;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2785
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2786
		    br = GetWindow_viewBgBrush(hWnd);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2787
		    if (br) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2788
			SetWindow_viewBgBrush(hWnd, 0);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2789
			_DeleteBrushIfNotInCache(br, __LINE__);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2790
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2791
		}
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2792
#ifdef CACHE_LAST_DC
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2793
		if (lastGcData && (lastGcHWIN == hWnd)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2794
		    _releaseDC(lastGcData);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2795
		}
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2796
#endif
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  2797
#ifdef CACHE_LAST_WM_PAINT_DC
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2798
		if (last_wm_paint_dc && (last_wm_paint_win == hWnd)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2799
		    ReleaseDC(hWnd, last_wm_paint_dc);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2800
		    last_wm_paint_win = last_wm_paint_dc = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2801
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2802
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2803
		if (! DestroyWindow(hWnd)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2804
		    DPRINTF(("DestroyWindow ERROR\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2805
		} else {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2806
#ifdef COUNT_RESOURCES
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2807
		    __cnt_createWindows--;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2808
		    RESPRINTF(("DestroyWindow -> %d\n", __cnt_createWindows));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2809
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2810
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2811
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2812
	    *pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2813
	    return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2814
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2815
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2816
	case WM_DESTROY:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2817
	    {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2818
		char *n = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2819
		localWindowInfo *lI;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2820
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2821
		lI = GETLOCALWINDOWINFOPTR(hWnd);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2822
		EVENT_PRINTF(("WM_DESTROY %x li=%x\n", hWnd, lI));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2823
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  2824
#ifdef TOPWINDOWCLASS
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2825
		if (lI) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2826
		    if (lI->flag & LI_TOPWIN) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2827
			n = (char*) malloc(200);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2828
			GetClassName(hWnd,n,200);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2829
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2830
		    /* freeing now done in other thread */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2831
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2832
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2833
		SETLOCALWINDOWINFOPTR(hWnd, 0);
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2834
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2835
#ifdef FREE_LI_IN_STX_PROCESS
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2836
		enqEvent(0, hWnd, WM_DESTROY, wParam, (int)n, (int)lI, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2837
#else
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2838
		if (lI) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2839
		    free(lI);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2840
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2841
		enqEvent(0, hWnd, WM_DESTROY, wParam, (int)n, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2842
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2843
		*pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2844
		return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2845
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2846
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2847
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2848
	case WM_GETMINMAXINFO:
4155
b557b9991c9c inform STX about WINDOWPOSCHANGED in EXITSIZEMOVE (not during moving)
ca
parents: 4154
diff changeset
  2849
b557b9991c9c inform STX about WINDOWPOSCHANGED in EXITSIZEMOVE (not during moving)
ca
parents: 4154
diff changeset
  2850
#ifndef PRE_13_APR_04_POSCHANGED_IN_EXITSIZEMOVE
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2851
	    if (inMove) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2852
		*pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2853
		return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2854
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2855
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2856
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2857
	    {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2858
		int minW, maxW;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2859
		localWindowInfo *lI;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2860
		LPMINMAXINFO lpmmi;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2861
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2862
		lpmmi = (LPMINMAXINFO) lParam;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2863
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2864
		EVENT_PRINTF2(("WM_GETMINMAXINFO handle=%x got min: %d/%d\n",
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2865
			    hWnd,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2866
			    lpmmi->ptMinTrackSize.x,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2867
			    lpmmi->ptMinTrackSize.y));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2868
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2869
		lI = GETLOCALWINDOWINFOPTR(hWnd);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2870
		if (lI && (lI->minWidth) && (lI->maxWidth)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2871
		  lpmmi->ptMaxSize.x = lI->maxWidth;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2872
		  lpmmi->ptMaxSize.y = lI->maxHeight;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2873
		  lpmmi->ptMaxTrackSize.x = lI->maxWidth;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2874
		  lpmmi->ptMaxTrackSize.y = lI->maxHeight;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2875
		  lpmmi->ptMinTrackSize.x = lI->minWidth;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2876
		  lpmmi->ptMinTrackSize.y = lI->minHeight;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2877
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2878
		  EVENT_PRINTF3(("WM_GETMINMAXINFO handle=%x return min: %d/%d max: %d/%d\n",
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2879
				  hWnd,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2880
				  lI->minWidth, lI->minHeight,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2881
				  lI->maxWidth, lI->maxHeight));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2882
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2883
		*pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2884
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2885
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2886
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2887
	case WM_SETCURSOR:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2888
	    {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2889
		HCURSOR curs;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2890
		int hitCode;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2891
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2892
		hitCode = LOWORD(lParam);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2893
		if (hitCode != HTCLIENT) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2894
		    /*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2895
		     * not in client area ...
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2896
		     */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2897
		    return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2898
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2899
		DDPRINTF(("WM_SETCURSOR\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2900
		curs = GetWindow_Cursor(hWnd);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2901
		if (curs) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2902
		    SetCursor(curs);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2903
		    *pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2904
		    return 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2905
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2906
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2907
	    return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2908
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2909
	case WM_WINDOWPOSCHANGED:
4155
b557b9991c9c inform STX about WINDOWPOSCHANGED in EXITSIZEMOVE (not during moving)
ca
parents: 4154
diff changeset
  2910
b557b9991c9c inform STX about WINDOWPOSCHANGED in EXITSIZEMOVE (not during moving)
ca
parents: 4154
diff changeset
  2911
#ifndef PRE_13_APR_04_POSCHANGED_IN_EXITSIZEMOVE
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2912
	    if (inMove) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2913
		*pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2914
		return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2915
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2916
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2917
	    if (hWnd == __rootWinSpezial) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2918
		/* can this happen ? */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2919
		*pDefault = 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2920
		return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2921
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2922
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2923
	    if (! inMove && (__currentCapture == CAPTURE_NONE)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2924
		POINT p;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2925
		HWND hWndChild,hWndTemp;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2926
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2927
		p.x = evRootX;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2928
		p.y = evRootY;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2929
		ScreenToClient(hWnd, &p);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2930
		hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2931
		do {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2932
		    hWndTemp = hWndChild;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2933
		    hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2934
		} while ((hWndChild) && (hWndChild != hWndTemp));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2935
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2936
		if (hWndChild /*&& (hWndChild != hWnd)*/) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2937
		    if (hWndChild != __currentPointerView) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2938
			int modifiers = getModifiers();
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2939
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2940
			if (__currentPointerView) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2941
			    if (inSizeMove) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2942
				if (needDelayedMouseLeaveWindow == NULL) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2943
				    needDelayedMouseLeaveWindow = __currentPointerView;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2944
				}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2945
			    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2946
				if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2947
				    enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2948
				    SetWindow_mouseXY(__currentPointerView, -9999, -9999);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2949
				}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2950
			    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2951
			    __currentPointerView = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2952
			}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2953
			if (inSizeMove) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2954
			    needDelayedMouseEnterWindow = hWndChild;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2955
			    delayedMouseEnterX = evRootX;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2956
			    delayedMouseEnterY = evRootY;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2957
			} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2958
			    if (GetWindow_eventMask(hWndChild) & EnterWindowMask) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2959
				enqEvent(EnterWindowMask, hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2960
				SetWindow_mouseXY(hWndChild, evRootX, evRootY);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2961
			    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2962
			    // SetFocus(hWndChild);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2963
			}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2964
			__currentPointerView = hWndChild;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2965
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2966
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2967
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2968
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2969
	    /*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2970
	     * ignore child window messages ...
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2971
	     */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2972
	    if (GetParent(hWnd) != NULL) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2973
		break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2974
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2975
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2976
	    {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2977
		WINDOWPOS *wp = (WINDOWPOS *)lParam;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2978
		RECT rct, dRect;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2979
		int x, y, w, h;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2980
		int dW, dH;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2981
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2982
#if 0
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2983
		dRect.left = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2984
		dRect.top = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2985
		dRect.right = 100;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2986
		dRect.bottom = 100;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2987
		winStyleBits = GetWindowLong(hWnd, GWL_STYLE);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2988
		winExStyleBits = GetWindowLong(hWnd, GWL_EXSTYLE);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2989
		AdjustWindowRectEx(&dRect, winStyleBits, 0, winExStyleBits);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2990
		dW = dRect.right - dRect.left;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2991
		dH = dRect.bottom - dRect.top;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2992
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2993
		GetClientRect(hWnd, &rct);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2994
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2995
		x = rct.left;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2996
		y = rct.top;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2997
		w = rct.right - rct.left;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2998
		h = rct.bottom - rct.top;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  2999
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3000
		if (__debug__) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3001
		    EVENT_PRINTF(("WM_WINDOWPOSCHANGED ["));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3002
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3003
		    if (wp->flags & SWP_NOSIZE) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3004
			EVENT_PRINTF(("NOSIZE "));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3005
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3006
		    if (wp->flags & SWP_NOMOVE) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3007
			EVENT_PRINTF(("NOMOVE "));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3008
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3009
		    if (wp->flags & SWP_NOZORDER) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3010
			EVENT_PRINTF(("NOZORDER "));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3011
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3012
		    if (wp->flags & SWP_NOREDRAW) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3013
			EVENT_PRINTF(("NOREDRAW "));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3014
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3015
		    if (wp->flags & SWP_NOACTIVATE) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3016
			EVENT_PRINTF(("NOACTIVATE "));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3017
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3018
		    if (wp->flags & SWP_FRAMECHANGED) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3019
			EVENT_PRINTF(("FRAMECHANGED "));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3020
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3021
		    if (wp->flags & SWP_NOCOPYBITS) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3022
			EVENT_PRINTF(("NOCOPYBITS "));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3023
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3024
		    if (wp->flags & SWP_NOOWNERZORDER) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3025
			EVENT_PRINTF(("NOOWNERZORDER "));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3026
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3027
		    if (wp->flags & SWP_NOSENDCHANGING) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3028
			EVENT_PRINTF(("NOSENDCHANGING "));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3029
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3030
		    if (wp->flags & SWP_DEFERERASE) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3031
			EVENT_PRINTF(("DEFERERASE "));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3032
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3033
		    if (wp->flags & SWP_ASYNCWINDOWPOS) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3034
			EVENT_PRINTF(("ASYNCWINDOWPOS "));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3035
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3036
		    if (wp->flags & SWP_HIDEWINDOW) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3037
			EVENT_PRINTF(("HIDEWINDOW "));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3038
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3039
		    if (wp->flags & SWP_SHOWWINDOW) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3040
			EVENT_PRINTF(("SHOWWINDOW "));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3041
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3042
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3043
		    EVENT_PRINTF(("] %d/%d %d/%d flags:%d (0x%x) ->",
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3044
				wp->x, wp->y, wp->cx, wp->cy, wp->flags, wp->flags));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3045
		    EVENT_PRINTF(("  client rect now: %d/%d %d/%d\n",x, y, w, h));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3046
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3047
		} /* __debug__ */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3048
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3049
		if ((w == 0) && (h == 0)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3050
		    EVENT_PRINTF(("w,h = 0.\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3051
		    if (! GetWindow_iconified(hWnd)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3052
			EVENT_PRINTF(("iconified.\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3053
			SetWindow_iconified(hWnd, 1);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3054
			DPRINTF(("WM_WINDOWPOSCHANGED to iconified (flags:0x%x)\n", wp->flags));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3055
			enqEvent(0, hWnd, __WM_ICONIFIED, 1, 0, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3056
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3057
		} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3058
		    if (GetWindow_iconified(hWnd)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3059
			EVENT_PRINTF(("deiconified.\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3060
			SetWindow_iconified(hWnd, 0);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3061
			DPRINTF(("WM_WINDOWPOSCHANGED to deiconified (flags:0x%x)\n", wp->flags));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3062
			enqEvent(0, hWnd, __WM_ICONIFIED, 0, 0, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3063
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3064
		    if (!(wp->flags & SWP_NOSIZE)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3065
		     || !(wp->flags & SWP_NOMOVE)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3066
			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
  3067
#ifdef COMPRESS_WINDOWPOSCHANGED
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3068
			/*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3069
			 * remember the current
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3070
			 * window and size;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3071
			 * This allows the backend to ignore
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3072
			 * intermediate events.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3073
			 */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3074
			lastPos_win = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3075
			lastPos_w = w;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3076
			lastPos_h = h;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3077
			lastPos_x = x;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3078
			lastPos_y = y;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3079
			lastPos_win = hWnd;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3080
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3081
			enqEvent(0, hWnd, WM_WINDOWPOSCHANGED, 0, x, y, w, h, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3082
		    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3083
			EVENT_PRINTF(("no event due to SWP_NOSIZE/SWP_NOMOVE.\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3084
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3085
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3086
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3087
	    *pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3088
	    return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3089
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3090
	case WM_ERASEBKGND:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3091
	    DPRINTFIF(__debug_WM_ERASEBKGND__ , ("WM_ERASEBKGND\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3092
	    if (isNative) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3093
		NDPRINTF(("WM_ERASEBKGND for native - default handling\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3094
		return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3095
	    }
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  3096
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  3097
#ifndef PRE_21_NOV
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3098
	    *pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3099
	    return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3100
#else
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3101
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3102
	    if (GetWindow_flag(hWnd) & LI_INPUTWIN) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3103
		*pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3104
		return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3105
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3106
	    if (hWnd == __rootWinSpezial) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3107
		*pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3108
		return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3109
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3110
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3111
	    /* THIS_WORKS */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3112
	    *pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3113
	    return 0;
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  3114
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  3115
#endif  /* ! PRE_21_NOV */
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3116
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3117
	case WM_PAINT:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3118
	    DPRINTFIF(__debug_WM_PAINT__ , ("WM_PAINT ********************* "));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3119
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3120
	    if (isNative) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3121
		NDPRINTF(("WM_PAINT for native - default handling\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3122
		return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3123
	    }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  3124
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  3125
#ifndef PRE_21_NOV
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3126
	    {   int n;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3127
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3128
		n = __generateExposes( hWnd, NULL, WM_PAINT, 0 );
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3129
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3130
		if( n <= 0 ) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3131
		    * pDefault = 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3132
		    return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3133
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3134
		* pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3135
		return n;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3136
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3137
#else
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3138
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3139
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3140
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3141
	    if (GetWindow_flag(hWnd) & LI_INPUTWIN) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3142
		*pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3143
		return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3144
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3145
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3146
	    if (hWnd == __rootWinSpezial) {
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3147
# ifdef THIS_MAKES_GUI_PAINTER_START_SLOW
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3148
		*pDefault = 0;
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3149
# endif
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3150
		return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3151
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3152
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3153
	    {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3154
		int retVal;
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3155
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  3156
# ifdef LATE_GENERATE_EXPOSE
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3157
		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
  3158
# else
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3159
		AQUIRE_DRAW_MUTEX
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3160
		retVal = __generateExposes(hWnd, NULL, WM_PAINT, WM_PAINT_CLEAR_EARLY);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3161
		RELEASE_DRAW_MUTEX
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  3162
# endif
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3163
		switch (retVal) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3164
		    case -1:  /* error */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3165
			*pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3166
			break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3167
		    case 0:   /* nothing generated */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3168
		    default:  /* generated events */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3169
			break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3170
		}
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3171
# ifdef THIS_IS_BAD
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3172
		*pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3173
		return 1;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  3174
# endif
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3175
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3176
	    return 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3177
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  3178
#endif  /* ! PRE_21_NOV */
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  3179
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3180
	case WM_SIZE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3181
	    DPRINTFIF(__debug_WM_SIZE__ , ("WM_SIZE\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3182
	    /*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3183
	     * ignore child window messages ...
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3184
	     */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3185
	    if (GetParent(hWnd) != NULL) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3186
		*pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3187
		return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3188
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3189
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3190
	    switch (wParam) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3191
		case SIZE_MAXIMIZED:     /* default handling */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3192
		case SIZE_MINIMIZED:     /* default handling */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3193
		case SIZE_RESTORED:      /* default handling */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3194
		    {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3195
			RECT rct;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3196
			int x, y, w, h;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3197
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3198
			GetClientRect(hWnd, &rct);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3199
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3200
			x = rct.left;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3201
			y = rct.top;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3202
			w = rct.right - rct.left;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3203
			h = rct.bottom - rct.top;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3204
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3205
			EVENT_PRINTF(("WM_MIN/MAX/RESTORED\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3206
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3207
			if ((w == 0) && (h == 0)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3208
			    /*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3209
			     * iconified ...
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3210
			     */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3211
			    if (! GetWindow_iconified(hWnd)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3212
				SetWindow_iconified(hWnd, 1);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3213
				enqEvent(0, hWnd, __WM_ICONIFIED, 1, 0, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3214
			    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3215
			} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3216
			    if (GetWindow_iconified(hWnd)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3217
				SetWindow_iconified(hWnd, 0);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3218
				enqEvent(0, hWnd, __WM_ICONIFIED, 0, 0, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3219
			    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3220
			    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
  3221
#ifdef COMPRESS_WINDOWPOSCHANGED
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3222
			    /*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3223
			     * remember the current
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3224
			     * window and size;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3225
			     * This allows the backend to ignore
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3226
			     * intermediate events.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3227
			     */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3228
			    lastPos_win = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3229
			    lastPos_w = w;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3230
			    lastPos_h = h;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3231
			    lastPos_x = x;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3232
			    lastPos_y = y;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3233
			    lastPos_win = hWnd;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3234
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3235
			    enqEvent(0, hWnd, WM_WINDOWPOSCHANGED, 0, x, y, w, h, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3236
			}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3237
		   }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3238
		   break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3239
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3240
		default:                 /* ignore */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3241
		    *pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3242
		    return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3243
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3244
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3245
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3246
	case WM_DROPFILES:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3247
	    DPRINTFIF(__debug_WM_DROPFILES__ , ("WM_DROPFILES\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3248
	    enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3249
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3250
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3251
	case WM_SHOWWINDOW:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3252
	    DPRINTFIF(__debug_WM_SHOWWINDOW__ , ("WM_SHOWWINDOW\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3253
	    enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3254
	    if (isNative) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3255
		NDPRINTF(("WM_SHOWWINDOW for native - default handling\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3256
		return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3257
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3258
	    *pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3259
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3260
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3261
	case WM_MOUSEACTIVATE :
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3262
	    DPRINTFIF(__debug_WM_MOUSEACTIVATE__ , ("WM_MOUSEACTIVATE h=%x parent=%x\n", hWnd, GetParent(hWnd)));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3263
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3264
	    /*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3265
	     * ignore child window messages ...
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3266
	     */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3267
	    if (GetParent(hWnd)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3268
		return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3269
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3270
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3271
	    *pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3272
	    if ((hWnd == __rootWinSpezial) || (hWnd == GetActiveWindow())) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3273
		DDPRINTF(("NOACTIVATE (root or already)\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3274
		return MA_NOACTIVATE;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3275
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3276
	    if (LOWORD(lParam) != HTCLIENT) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3277
		DDPRINTF(("ACTIVATE (not client)\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3278
		return MA_ACTIVATE;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3279
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3280
	    if (__activateOnClick) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3281
		if (__ignoreButtonPressOnActivate) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3282
		    DDPRINTF(("ACTIVATE_EAT\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3283
		    /*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3284
		     * windows is sooo stupid:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3285
		     * it will send me a MOTION soon after, with the
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3286
		     * to the click location, with the buttonState down.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3287
		     * The app will interpret that as a pressed motion and
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3288
		     * do a selection (if in a textview).
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3289
		     * To prevent this, we set a flag here, that the following
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3290
		     * motion is to be suppressed.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3291
		     * Until the mouse is released.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3292
		     */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3293
		    __eatingMouseEvents = 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3294
		    return MA_ACTIVATEANDEAT;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3295
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3296
		DDPRINTF(("ACTIVATE\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3297
		return MA_ACTIVATE;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3298
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3299
	    DDPRINTF(("NO_ACTIVATE\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3300
	    return MA_NOACTIVATE;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3301
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3302
	case WM_NCHITTEST:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3303
	    EVENT_PRINTF2(("WM_NCHITTEST\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3304
	    if (hWnd == __rootWinSpezial) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3305
		*pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3306
		return HTCLIENT;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3307
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3308
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3309
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3310
	case WM_NCACTIVATE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3311
	    EVENT_PRINTF(("WM_NCACTIVATE\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3312
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3313
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3314
	case WM_ACTIVATE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3315
	    CPRINTF(("WM_ACTIVATE %s h=%x\n", LOWORD(wParam) ? "active" : "inactive", hWnd));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3316
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3317
	    switch (LOWORD(wParam)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3318
		case WA_INACTIVE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3319
		    EVENT_PRINTF2(("WM_ACTIVATE inactive h=%x\n", hWnd));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3320
		    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3321
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3322
		case WA_ACTIVE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3323
		    EVENT_PRINTF2(("WM_ACTIVATE active h=%x\n", hWnd));
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3324
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3325
#ifdef THIS_DOES_NOT_AVOID_DOUBLE_REPAINTS
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3326
		    __generateRecursiveExposes(hWnd, WM_PAINT);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3327
#endif /* sigh */
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3328
		    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3329
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3330
		case WA_CLICKACTIVE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3331
		    EVENT_PRINTF2(("++ WM_ACTIVATE clkactive h=%x\n", hWnd));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3332
		    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3333
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3334
		default:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3335
		    EVENT_PRINTF2(("WM_ACTIVATE ? h=%x\n", hWnd));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3336
		    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3337
	    }
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3338
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3339
#ifndef PRE_25_NOV_03
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3340
	    if (__currentCapture == CAPTURE_NONE) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3341
		HWND  newHWnd = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3342
		POINT newPoint;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3343
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3344
		if (LOWORD(wParam) != WA_INACTIVE) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3345
		    if (MustHandleButtonEvent()) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3346
			newPoint.x = evRootX;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3347
			newPoint.y = evRootY;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3348
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3349
			newHWnd = WindowFromPoint (newPoint);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3350
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3351
			if (newHWnd) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3352
			    if ( (newHWnd == hWnd) || IsChild(hWnd, newHWnd) ) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3353
				ScreenToClient (newHWnd, & newPoint);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3354
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3355
				if ((newPoint.x < 0) || (newPoint.y < 0)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3356
				    newHWnd = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3357
				}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3358
			    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3359
				newHWnd = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3360
			    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3361
			}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3362
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3363
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3364
		CPRINTF(( "Old Handle: %x New Handle: %x  x:%d y:%d\n", __currentPointerView, newHWnd, newPoint.x, newPoint.y));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3365
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3366
		if (newHWnd != __currentPointerView) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3367
		    int modifiers = getModifiers();
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3368
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3369
		    if (__currentPointerView) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3370
			if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3371
			    enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3372
			    SetWindow_mouseXY(__currentPointerView, -9999, -9999);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3373
			}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3374
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3375
		    __currentPointerView = newHWnd;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3376
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3377
		    if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3378
			enqEvent(EnterWindowMask, __currentPointerView, __WM_MOUSEENTER, 0, newPoint.x, newPoint.y, 0, modifiers, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3379
			SetWindow_mouseXY(__currentPointerView, newPoint.x, newPoint.y);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3380
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3381
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3382
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3383
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3384
	    enqEvent(0, hWnd, WM_ACTIVATE, wParam, 0, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3385
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3386
	    if (isNative) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3387
		return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3388
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3389
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3390
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3391
	case WM_SYSCHAR:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3392
	    EVENT_PRINTF2(("WM_SYSCHAR h=%x %x\n", hWnd, wParam));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3393
	    goto commonChar;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3394
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  3395
#ifdef WM_UNICHAR
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3396
	/* does not work, anyway */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3397
	case WM_UNICHAR:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3398
	    DPRINTFIF(__debug_WM_CHAR__ , ("WM_UNICHAR h=%x %x\n", hWnd, wParam));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3399
	    if (wParam == UNICODE_NOCHAR) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3400
		/* this is a query from windows to see if I am able to receive unicode... */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3401
		*pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3402
		return 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3403
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3404
	    goto commonChar;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3405
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3406
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3407
	case WM_CHAR:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3408
	    DPRINTFIF(__debug_WM_CHAR__ , ("WM_CHAR h=%x %x\n", hWnd, wParam));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3409
#if 0
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3410
	    EVENT_PRINTF2(("WM_CHAR h=%x %x\n", hWnd, wParam));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3411
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3412
	commonChar:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3413
	    if (isNative) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3414
		NDPRINTF(("WM_CHAR for native - default handling\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3415
		return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3416
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3417
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3418
	    {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3419
		HWND destWindow;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3420
		int evMask;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3421
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3422
		if (__focusFollowsMouse) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3423
		    destWindow = __currentPointerView;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3424
		    if (destWindow == 0) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3425
			destWindow = hWnd;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3426
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3427
		} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3428
		    destWindow = hWnd;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3429
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3430
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3431
		evMask = GetWindow_eventMask(destWindow);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3432
		if (evMask & (KeyPressMask | KeyReleaseMask)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3433
		    POINT p;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3434
		    int modifiers = getModifiers();
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3435
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3436
		    p.x = evRootX;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3437
		    p.y = evRootY;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3438
		    ScreenToClient(destWindow, &p);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3439
		    x = p.x;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3440
		    y = p.y;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3441
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3442
		    DPRINTFIF(__debug_WM_CHAR__ , ("key:%x modifiers: %x\n", wParam, modifiers));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3443
		    if (evMask & KeyPressMask)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3444
			enqEvent(KeyPressMask, destWindow, WM_KEYDOWN, wParam, x, y, lParam, (modifiers | TRANSLATED_KEY), evTime);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3445
		    if (evMask & KeyReleaseMask)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3446
			enqEvent(KeyReleaseMask, destWindow, WM_KEYUP, wParam, x, y, lParam, (modifiers | TRANSLATED_KEY), evTime);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3447
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3448
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3449
	    *pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3450
	    return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3451
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3452
	case WM_KEYUP:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3453
	    DPRINTFIF(__debug_WM_KEYUP__ , ("WM_KEYUP h=%x %x\n", hWnd, wParam));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3454
	    goto commonKeyUp;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3455
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3456
	case WM_SYSKEYUP:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3457
	    DPRINTFIF(__debug_WM_KEYUP__ , ("WM_SYSKEYUP %x\n, wParam"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3458
	commonKeyUp:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3459
	    if (isNative) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3460
		NDPRINTF(("WM_KEYUP/WM_SYSKEYUP for native - default handling\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3461
		return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3462
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3463
	    {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3464
		HWND destWindow;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3465
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3466
		if (__focusFollowsMouse) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3467
		    destWindow = __currentPointerView;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3468
		    if (destWindow == 0) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3469
			destWindow = hWnd;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3470
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3471
		} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3472
		    destWindow = hWnd;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3473
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3474
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3475
		if (GetWindow_eventMask(destWindow) & KeyReleaseMask) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3476
		    POINT p;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3477
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3478
		    p.x = evRootX;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3479
		    p.y = evRootY;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3480
		    ScreenToClient(destWindow, &p);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3481
		    x = p.x;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3482
		    y = p.y;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3483
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3484
		    enqEvent(KeyReleaseMask, destWindow, message, wParam, x, y, lParam, getModifiers(), evTime);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3485
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3486
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3487
	    *pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3488
	    return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3489
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3490
	case WM_SYSKEYDOWN:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3491
	    DPRINTFIF(__debug_WM_KEYDOWN__ , ("WM_SYSKEYDOWN %x\n, wParam"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3492
	    goto commonKey;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3493
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3494
	case WM_KEYDOWN:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3495
	    DPRINTFIF(__debug_WM_KEYDOWN__ , ("WM_KEYDOWN h=%x %x\n", hWnd, wParam));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3496
	commonKey:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3497
	    if (isNative) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3498
		NDPRINTF(("WM_KEYDOWN/WM_SYSKEYDOWN for native - default handling\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3499
		return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3500
	    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3501
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3502
#ifdef EXIT_WITH_3_CTRL_Cs
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3503
	    if ((msg.wParam == 'c')
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3504
	     && (GetKeyState(VK_CONTROL) & 0x8000)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3505
		/* CTRL-C */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3506
		if (ctrl_c_count++ > 3)  /* for debugging */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3507
		    exit(1);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3508
	    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3509
		if (msg.wParam != VK_CONTROL)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3510
		    ctrl_c_count = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3511
	    }
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3512
#endif
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  3513
#ifdef RELEASE_CAPTURE_WITH_3_ESCAPEs
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3514
	    if (msg.wParam == VK_ESCAPE)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3515
		/* ESCAPE */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3516
		if (escape_count++ > 3) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3517
		    __currentCapture = CAPTURE_NONE;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3518
		    ReleaseCapture();
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3519
		    CPRINTF(("ReleaseCapture <ESC>\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3520
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3521
	    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3522
		escape_count = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3523
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3524
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3525
	    /* FALL INTO */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3526
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3527
	    {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3528
		HWND destWindow;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3529
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3530
		if (__focusFollowsMouse) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3531
		    destWindow = __currentPointerView;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3532
		    if (destWindow == 0) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3533
			destWindow = hWnd;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3534
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3535
		} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3536
		    destWindow = hWnd;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3537
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3538
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3539
		if (GetWindow_eventMask(destWindow) & KeyPressMask) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3540
		    POINT p;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3541
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3542
		    p.x = evRootX;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3543
		    p.y = evRootY;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3544
		    ScreenToClient(destWindow, &p);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3545
		    x = p.x;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3546
		    y = p.y;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3547
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3548
		    enqEvent(KeyPressMask, destWindow, message, wParam, x, y, lParam, getModifiers(), evTime);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3549
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3550
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3551
	    *pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3552
	    return 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3553
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3554
#ifdef WM_MOUSEWHEEL
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3555
	case WM_MOUSEWHEEL:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3556
	    {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3557
		HWND destWindow;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3558
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3559
		if (__focusFollowsMouse) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3560
		    destWindow = __currentPointerView;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3561
		    if (destWindow == 0) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3562
			destWindow = hWnd;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3563
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3564
		} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3565
		    destWindow = hWnd;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3566
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3567
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3568
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3569
		EVENT_PRINTF(("WM_MOUSEWHEEL h=%x wP=%x lP=%x\n", hWnd, wParam, lParam));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3570
		if (GetWindow_eventMask(destWindow) & KeyPressMask) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3571
		    POINT p;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3572
		    int delta;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3573
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3574
		    p.x = evRootX;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3575
		    p.y = evRootY;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3576
		    ScreenToClient(destWindow, &p);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3577
		    x = p.x;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3578
		    y = p.y;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3579
		    delta = evTime - lastMouseWheelTime;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3580
		    if (evTime < lastMouseWheelTime) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3581
			delta = (0xFFFFFFFF - lastMouseWheelTime) + evTime;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3582
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3583
		    enqEvent(0, destWindow, message, wParam, x, y, lParam, getModifiers(), delta);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3584
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3585
		lastMouseWheelTime = evTime;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3586
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3587
	    *pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3588
	    return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3589
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3590
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3591
	case WM_MOUSEMOVE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3592
	    DPRINTFIF(__debug_WM_MOUSEMOVE__ , ("WM_MOUSEMOVE h=%x\n", hWnd));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3593
	    if (isNative) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3594
		NDPRINTF(("WM_MOUSEMOVE for native - default handling\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3595
		return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3596
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3597
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3598
	    if (hWnd != __currentPointerView) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3599
		if (! MustHandleButtonEvent()) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3600
		    *pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3601
		    return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3602
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3603
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3604
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3605
	    {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3606
		short x, y;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3607
		int modifiers = getModifiers();
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3608
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3609
		x = (int)(short)LOWORD(lParam);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3610
		y = (int)(short)HIWORD(lParam);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3611
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3612
		if (__currentCapture == CAPTURE_NONE) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3613
		    if (hWnd != __currentPointerView) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3614
			HWND prevPointerView;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3615
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3616
			prevPointerView = __currentPointerView;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3617
			if (prevPointerView) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3618
			    if (inSizeMove) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3619
				if (needDelayedMouseLeaveWindow == NULL) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3620
				    needDelayedMouseLeaveWindow = __currentPointerView;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3621
				}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3622
			    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3623
				if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3624
				    enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, evTime);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3625
				    SetWindow_mouseXY(__currentPointerView, -9999, -9999);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3626
				}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3627
			    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3628
			    __currentPointerView = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3629
			}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3630
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3631
#if 0
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3632
			if (__activateOnClick) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3633
			    /*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3634
			     * only send mouseEnter if the window belongs to the current
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3635
			     * active window
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3636
			     */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3637
			    if (GetTopParent(prevPointerView) == GetTopParent(hWnd)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3638
			    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3639
			}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3640
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3641
			if (inSizeMove) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3642
			    needDelayedMouseEnterWindow = hWnd;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3643
			    delayedMouseEnterX = x;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3644
			    delayedMouseEnterY = y;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3645
			} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3646
			    if (GetWindow_eventMask(hWnd) & EnterWindowMask) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3647
				enqEvent(EnterWindowMask, hWnd, __WM_MOUSEENTER, 0, x, y, 0, modifiers, evTime);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3648
				SetWindow_mouseXY(hWnd, x, y);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3649
			    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3650
			}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3651
			__currentPointerView = hWnd;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3652
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3653
		    DDPRINTF(("MouseMove %x\n", __currentPointerView));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3654
		} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3655
		    CPRINTF(("MouseMove Capture %x\n", __currentPointerView));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3656
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3657
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3658
		if ((GetWindow_eventMask(__currentPointerView) & PointerMotionMask)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3659
		 || (modifiers & AnyButtonMask)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3660
		    if (! __eatingMouseEvents) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3661
			if ((x == lastMotionX)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3662
			 && (y == lastMotionY)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3663
			 && (__currentPointerView == lastMotionWnd)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3664
			    /* ignore */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3665
			} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3666
			    lastMotionX = x;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3667
			    lastMotionY = y;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3668
			    lastMotionWnd = __currentPointerView;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3669
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3670
			    if ((GetWindow_mouseX(__currentPointerView) == x)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3671
			     && (GetWindow_mouseY(__currentPointerView) == y)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3672
			    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3673
				enqEvent(PointerMotionMask, __currentPointerView, WM_MOUSEMOVE, wParam, x, y, 0, modifiers, evTime);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3674
				SetWindow_mouseXY(__currentPointerView, x, y);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3675
			    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3676
			}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3677
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3678
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3679
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3680
	    *pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3681
	    return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3682
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3683
	case WM_LBUTTONUP:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3684
	    curButton = Button1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3685
	    goto commonButtonUp;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3686
	case WM_MBUTTONUP:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3687
	    curButton = Button2;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3688
	    goto commonButtonUp;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3689
	case WM_RBUTTONUP:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3690
	    curButton = Button3;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3691
commonButtonUp:
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3692
	    if (isNative) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3693
		NDPRINTF(("WM_*BUTTONUP for native - default handling\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3694
		return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3695
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3696
4132
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  3697
#ifndef PRE_01_APR_04
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3698
	    if ((__currentPointerView != hWnd) && (__currentPointerView == (HANDLE)0)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3699
		__currentPointerView = hWnd;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3700
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3701
		if (GetWindow_eventMask(hWnd) & EnterWindowMask) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3702
		    POINT p;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3703
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3704
		    p.x = evRootX;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3705
		    p.y = evRootY;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3706
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3707
		    ScreenToClient (hWnd, & p);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3708
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3709
		    if ((p.x >= 0) && (p.y >= 0)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3710
			enqEvent(EnterWindowMask, hWnd, __WM_MOUSEENTER, 0, p.x, p.y, 0, getModifiers(), EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3711
			SetWindow_mouseXY(hWnd, p.x, p.y);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3712
		    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3713
			__currentPointerView = (HANDLE) 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3714
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3715
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3716
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3717
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3718
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3719
	    if (__currentCapture == curButton /* CAPTURE_IMPLICIT*/) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3720
		__currentCapture = CAPTURE_NONE;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3721
		ReleaseCapture();
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3722
		CPRINTF(("ReleaseCapture <BUTTONUP>\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3723
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3724
	    EVENT_PRINTF3(("WM_BUTTONUP h=%x pos=%d/%d\n",
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3725
			   hWnd, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam)));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3726
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3727
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3728
	    if (GetWindow_eventMask(hWnd) & ButtonReleaseMask) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3729
		if (__eatingMouseEvents) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3730
		    __eatingMouseEvents = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3731
		} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3732
		    enqEvent(ButtonReleaseMask, hWnd,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3733
			     message, wParam, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam),
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3734
			     wParam, getModifiers(), evTime);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3735
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3736
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3737
	    *pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3738
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3739
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3740
	case WM_LBUTTONDOWN:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3741
	    curButton = Button1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3742
	    goto commonButtonDown;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3743
	case WM_MBUTTONDOWN:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3744
	    curButton = Button2;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3745
	    goto commonButtonDown;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3746
	case WM_RBUTTONDOWN:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3747
	    curButton = Button3;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3748
commonButtonDown:
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3749
	    if (isNative) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3750
		NDPRINTF(("WM_*BUTTONDOWN for native - default handling\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3751
		return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3752
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3753
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3754
	    if (__currentCapture == CAPTURE_NONE) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3755
		__currentCapture = curButton /*CAPTURE_IMPLICIT*/;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3756
		//SetFocus(hWnd);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3757
		SetCapture(hWnd);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3758
		CPRINTF(("SetCapture <BUTTONDOWN>%x\n",hWnd));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3759
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3760
	    goto commonButton;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3761
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3762
	case WM_LBUTTONDBLCLK:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3763
	case WM_MBUTTONDBLCLK:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3764
	case WM_RBUTTONDBLCLK:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3765
	    if (isNative) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3766
		NDPRINTF(("WM_*BUTTONDBLCLK for native - default handling\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3767
		return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3768
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3769
	commonButton:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3770
	    EVENT_PRINTF3(("WM_BUTTONDOWN h=%x pos=%d/%d\n",
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3771
			   hWnd, LOWORD(lParam), HIWORD(lParam)));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3772
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3773
	    if (GetWindow_eventMask(hWnd) & ButtonPressMask) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3774
		if (__eatingMouseEvents) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3775
		    __eatingMouseEvents = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3776
		} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3777
		    enqEvent(ButtonPressMask, hWnd,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3778
			     message, wParam, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam),
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3779
			     wParam, getModifiers(), evTime);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3780
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3781
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3782
	    *pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3783
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3784
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3785
	case WM_CAPTURECHANGED:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3786
	    CPRINTF(("WM_CAPTURECHANGED %x to %x\n",hWnd,lParam));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3787
#if 0
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3788
	    if ((__currentCapture != CAPTURE_NONE) && (__currentCapture != CAPTURE_EXPLICIT))
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3789
	    {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3790
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3791
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3792
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3793
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3794
	case WM_KILLFOCUS:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3795
	    CPRINTF(("WM_KILLFOCUS\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3796
	    //enqEvent(0, hWnd, WM_KILLFOCUS, wParam, 0, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3797
	    if (isNative) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3798
		NDPRINTF(("WM_KILLFOCUS for native - default handling\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3799
		return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3800
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3801
	    *pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3802
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3803
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3804
	case WM_SETFOCUS:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3805
	    CPRINTF(("WM_SETFOCUS %x\n",hWnd));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3806
#if 0
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3807
	    //enqEvent(0,hWnd, WM_SETFOCUS, wParam, 0, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3808
	    {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3809
		POINT p;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3810
		HWND hWndChild,hWndTemp;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3811
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3812
		p.x = evRootX;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3813
		p.y = evRootY;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3814
		ScreenToClient(hWnd, &p);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3815
		hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3816
		do {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3817
		    hWndTemp = hWndChild;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3818
		    hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3819
		} while ((hWndChild) && (hWndChild != hWndTemp));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3820
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3821
		/*console_printf("WM_ACTIVATE active h=%x p=%d.%d in %x\n", hWnd,p.x,p.y,hWndChild);*/
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3822
		if (hWndChild /*&& (hWndChild != hWnd)*/) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3823
		    if (hWndChild != __currentPointerView) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3824
			int modifiers = getModifiers();
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3825
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3826
			if (__currentPointerView) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3827
			    if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3828
				enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3829
				SetWindow_mouseXY(__currentPointerView, -9999, -9999);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3830
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3831
			    __currentPointerView = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3832
			}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3833
			if (GetWindow_eventMask(hWndChild) & EnterWindowMask) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3834
			    enqEvent(EnterWindowMask, hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3835
			    SetWindow_mouseXY(hWndChild, evRootX, evRootY);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3836
			}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3837
			//SetFocus(hWndChild);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3838
			__currentPointerView = hWndChild;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3839
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3840
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3841
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3842
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3843
	    if (isNative) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3844
		NDPRINTF(("WM_SETFOCUS for native - default handling\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3845
		return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3846
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3847
	    *pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3848
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3849
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3850
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3851
	case WM_GETTEXT:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3852
	    /*EVENT_PRINTF(("WM_GETTEXT %x\n", message));*/
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3853
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3854
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3855
	case WM_GETTEXTLENGTH:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3856
	    EVENT_PRINTF(("WM_GETTEXTLENGTH %x\n", message));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3857
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3858
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3859
	case WM_NCCREATE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3860
	    EVENT_PRINTF(("WM_NCCREATE %x\n", message));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3861
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3862
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3863
	case WM_NCMOUSEMOVE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3864
	    if (__currentCapture == CAPTURE_NONE) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3865
		if (__currentPointerView && (hWnd != __currentPointerView)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3866
		    if (inSizeMove) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3867
			if (needDelayedMouseLeaveWindow == NULL) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3868
			    needDelayedMouseLeaveWindow = __currentPointerView;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3869
			}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3870
		    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3871
			if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3872
			    enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers(), evTime);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3873
			    SetWindow_mouseXY(__currentPointerView, -9999, -9999);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3874
			}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3875
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3876
		    __currentPointerView = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3877
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3878
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3879
	    *pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3880
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3881
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3882
	case WM_PARENTNOTIFY:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3883
	    EVENT_PRINTF2(("WM_PARENTNOTIFY h=%x hChild=%x %d\n",
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3884
				hWnd, lParam, LOWORD(wParam)));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3885
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3886
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3887
	case WM_NCLBUTTONDOWN:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3888
	    DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_NCLBUTTONDOWN\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3889
	    if (__shiftedLeftButtonIsLowerWindow) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3890
		/*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3891
		 * with shift, this is a lower-operation
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3892
		 */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3893
		if (GetKeyState(VK_SHIFT) & 0x8000) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3894
		    SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 0, 0,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3895
				 SWP_NOSENDCHANGING |
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3896
				 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3897
		    *pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3898
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3899
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3900
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3901
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3902
	case WM_NCLBUTTONUP:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3903
	    DPRINTFIF(__debug_WM_BUTTONUP__ , ("WM_NCLBUTTONUP\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3904
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3905
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3906
	case WM_NCRBUTTONDOWN:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3907
	    DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_NCRBUTTONDOWN\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3908
	    if (__rightButtonIsLowerWindow) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3909
		/*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3910
		 * this is a lower-operation
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3911
		 */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3912
		SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 0, 0,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3913
			     SWP_NOSENDCHANGING |
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3914
			     SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3915
		*pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3916
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3917
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3918
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3919
	case WM_NCRBUTTONUP:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3920
	    DPRINTFIF(__debug_WM_BUTTONUP__ , ("WM_NCRBUTTONUP\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3921
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3922
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3923
	case WM_NCMBUTTONDOWN:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3924
	    DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_NCMBUTTONDOWN\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3925
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3926
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3927
	case WM_NCMBUTTONUP:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3928
	    DPRINTFIF(__debug_WM_BUTTONUP__ , ("WM_NCMBUTTONUP\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3929
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3930
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3931
	case WM_NCLBUTTONDBLCLK:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3932
	    EVENT_PRINTF(("WM_NCLBUTTONDBLCLK\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3933
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3934
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3935
	case WM_NCRBUTTONDBLCLK:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3936
	    EVENT_PRINTF(("WM_NCRBUTTONDBLCLK\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3937
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3938
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3939
	case WM_NCMBUTTONDBLCLK:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3940
	    EVENT_PRINTF(("WM_NCMBUTTONDBLCLK\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3941
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3942
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3943
	case WM_SETTEXT:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3944
	    DPRINTFIF(__debug_WM_SETTEXT__ , ("WM_SETTEXT\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3945
	    break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3946
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3947
#ifdef WM_SYNCPAINT
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3948
	case WM_SYNCPAINT:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3949
	    EVENT_PRINTF(("WM_SYNCPAINT\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3950
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3951
#else
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3952
	case 0x88:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3953
	    EVENT_PRINTF(("0x88 (undoc)\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3954
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3955
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3956
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3957
	case WM_NCCALCSIZE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3958
	    EVENT_PRINTF(("WM_NCCALCSIZE\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3959
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3960
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3961
	case WM_NCPAINT:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3962
	    EVENT_PRINTF3(("WM_NCPAINT\n"));
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3963
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3964
#ifdef THIS_DOES_NOT_WORK
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3965
	    /* mhmh - something is drawn, but clipped wrong
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3966
	     * and with wrong colors ....
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3967
	     */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3968
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3969
	    /*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3970
	     * child windows only ...
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3971
	     */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3972
	    if (GetParent(hWnd)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3973
		int clr;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3974
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3975
		clr = GetWindow_bdColor(hWnd);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3976
		if (clr != BlackPixel) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3977
		    /*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3978
		     * draw it here
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3979
		     */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3980
		    HBRUSH br;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3981
		    RECT rect, lineRect;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3982
		    HDC hDC;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3983
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3984
		    if (clr == WhitePixel) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3985
			br = __whiteBrush;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3986
		    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3987
			br = CreateSolidBrush(clr);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3988
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3989
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3990
		    GetWindowRect(hWnd, &rect);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3991
		    hDC = GetWindowDC(hWnd);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3992
		    SelectClipRgn(hDC, NULL);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3993
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3994
		    lineRect.left = rect.left;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3995
		    lineRect.right = rect.right;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3996
		    lineRect.top = rect.top;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3997
		    lineRect.bottom = rect.top + 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3998
		    FillRect(hDC, &lineRect, br);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  3999
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4000
		    lineRect.bottom = rect.bottom - 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4001
		    lineRect.bottom = rect.bottom;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4002
		    FillRect(hDC, &lineRect, br);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4003
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4004
		    lineRect.top = rect.top;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4005
		    lineRect.bottom = rect.bottom;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4006
		    lineRect.left = rect.left;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4007
		    lineRect.right = rect.left + 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4008
		    FillRect(hDC, &lineRect, br);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4009
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4010
		    lineRect.left = rect.right - 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4011
		    lineRect.right = rect.right;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4012
		    FillRect(hDC, &lineRect, br);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4013
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4014
		    _DeleteBrush(br, __LINE__);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4015
		    ReleaseDC(hWnd, hDC);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4016
		    *pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4017
		    return 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4018
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4019
	    }
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  4020
#endif /* THIS_DOES_NOT_WORK */
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4021
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4022
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4023
	case WM_SYSCOMMAND:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4024
	    switch (wParam & ~0x000F) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4025
		case SC_CLOSE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4026
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_CLOSE\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4027
		    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4028
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4029
		case SC_MOVE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4030
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_MOVE\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4031
		    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4032
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4033
		case SC_RESTORE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4034
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_RESTORE\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4035
		    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4036
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4037
		case SC_SIZE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4038
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_SIZE\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4039
		    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4040
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4041
		default:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4042
		    EVENT_PRINTF2(("WM_SYSCOMMAND %x\n", wParam));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4043
		    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4044
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4045
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4046
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4047
	case WM_INITMENU:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4048
	    EVENT_PRINTF(("WM_INITMENU\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4049
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4050
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4051
	case WM_INITMENUPOPUP:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4052
	    EVENT_PRINTF(("WM_INITMENUPOPUP\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4053
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4054
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4055
	case WM_ENTERIDLE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4056
	    EVENT_PRINTF(("WM_ENTERIDLE\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4057
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4058
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4059
	case WM_ENTERMENULOOP:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4060
	    EVENT_PRINTF(("WM_ENTERMENULOOP\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4061
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4062
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4063
	case WM_EXITMENULOOP:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4064
	    EVENT_PRINTF(("WM_EXITMENULOOP\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4065
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4066
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4067
	case WM_MENUSELECT:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4068
	    EVENT_PRINTF(("WM_MENUSELECT\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4069
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4070
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4071
	case WM_QUIT:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4072
	    DPRINTF(("quit message hWnd=0x%x lP=0x%x wP=0x%x\n", hWnd, lParam, wParam));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4073
	    enqEvent(0, 0, WM_QUIT, wParam, lParam, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4074
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4075
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4076
	case WM_NCDESTROY:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4077
	    EVENT_PRINTF(("WM_NCDESTROY\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4078
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4079
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4080
	case WM_QUERYNEWPALETTE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4081
	    EVENT_PRINTF(("WM_QUERYNEWPALETTE\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4082
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4083
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4084
	case WM_PALETTECHANGED:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4085
	    EVENT_PRINTF(("WM_PALETTECHANGED\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4086
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4087
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4088
	case WM_ACTIVATEAPP:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4089
	    EVENT_PRINTF2(("WM_ACTIVATEAPP %s\n", wParam ? "active" : "inactive"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4090
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4091
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4092
	case WM_SYSDEADCHAR:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4093
	    EVENT_PRINTF2(("WM_SYSDEADCHAR %x\n, wParam"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4094
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4095
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4096
	case WM_DEADCHAR:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4097
	    EVENT_PRINTF2(("WM_DEADCHAR %x\n, wParam"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4098
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4099
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4100
	case WM_PAINTICON:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4101
	    EVENT_PRINTF(("WM_PAINTICON\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4102
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4103
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4104
	case WM_ICONERASEBKGND:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4105
	    EVENT_PRINTF(("WM_ICONERASEBKGND\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4106
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4107
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4108
	case WM_WINDOWPOSCHANGING:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4109
	    DPRINTFIF(__debug_WM_WINDOWPOSCHANGING__ , ("WM_WINDOWPOSCHANGING\n"));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4110
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4111
#ifdef HANDLE_VIEWGRAVITY
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4112
	    /*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4113
	     * any child with a viewGravity ?
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4114
	     * (only care for topViews here;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4115
	     *  child views do it on the smalltalk level ...)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4116
	     */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4117
	    if (GetParent(hWnd) == 0) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4118
		if (GetParent(hWnd) == 0) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4119
		    struct gravityCallBackInfo i;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4120
		    RECT rct, dRect;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4121
		    int dW, dH;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4122
		    WINDOWPOS *wp = (WINDOWPOS *)lParam;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4123
		    int winStyleBits, winExStyleBits;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4124
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4125
		    if (! (wp->flags & SWP_NOSIZE)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4126
			dRect.left = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4127
			dRect.top = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4128
			dRect.right = 100;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4129
			dRect.bottom = 100;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4130
			winStyleBits = GetWindowLong(hWnd, GWL_STYLE);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4131
			winExStyleBits = GetWindowLong(hWnd, GWL_EXSTYLE);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4132
			AdjustWindowRectEx(&dRect, winStyleBits, 0, winExStyleBits);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4133
			dW = dRect.right - dRect.left;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4134
			dH = dRect.bottom - dRect.top;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4135
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4136
			GetClientRect(hWnd, &rct);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4137
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4138
			i.parent = hWnd;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4139
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4140
			i.currW = rct.right - rct.left;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4141
			i.currH = rct.bottom - rct.top;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4142
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4143
			/* wp gives us the new outer (frame) bounds */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4144
			i.newW = wp->cx - (dW - 100);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4145
			i.newH = wp->cy - (dH - 100);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4146
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4147
			if ((i.currW != i.newW)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4148
			 || (i.currH != i.newH)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4149
			    DPRINTF((stderr, "about to sizeChange old: %d/%d new: %d/%d\n",
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4150
				    i.currW, i.currH, i.newW, i.newH));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4151
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4152
			    GetWindowRect(hWnd, &rct);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4153
			    i.parentWinX = rct.left - dRect.left;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4154
			    i.parentWinY = rct.top - dRect.top;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4155
			    EnumChildWindows(hWnd, gravityEnumeratorCallBack, (int)(&i));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4156
			}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4157
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4158
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4159
	    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4160
#endif /* HANDLE_VIEWGRAVITY */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4161
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4162
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4163
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4164
	case WM_QUERYOPEN:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4165
	    EVENT_PRINTF(("WM_QUERYOPEN\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4166
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4167
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4168
	case WM_QUERYENDSESSION:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4169
	    EVENT_PRINTF(("WM_QUERYENDSESSION\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4170
	    *pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4171
	    if (@global(CanEndSession) == false) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4172
		enqEvent(0, hWnd, WM_QUERYENDSESSION, wParam, 0, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4173
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4174
		// TODO: enter new event loop
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4175
		// which is left when an endSessionConfirmation
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4176
		// arrives from smalltalk
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4177
		// (either positive or negative).
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4178
		// for now, do not allow leaving
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4179
		// windows as long as ST/X is open.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4180
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4181
		return(0);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4182
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4183
	    return(TRUE);  // allow leaving windows
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4184
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4185
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4186
	case WM_ENDSESSION:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4187
	    EVENT_PRINTF(("WM_ENDSESSION\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4188
	    enqEvent(0, hWnd, WM_ENDSESSION, wParam, 0, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4189
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4190
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4191
	case WM_DISPLAYCHANGE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4192
	    EVENT_PRINTF(("WM_DISPLAYCHANGE\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4193
	    enqEvent(0, hWnd, WM_DISPLAYCHANGE, wParam, 0, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4194
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4195
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4196
	case WM_FONTCHANGE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4197
	    EVENT_PRINTF(("WM_FONTCHANGE\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4198
	    enqEvent(0, hWnd, WM_FONTCHANGE, wParam, 0, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4199
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4200
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4201
	case WM_WININICHANGE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4202
	    EVENT_PRINTF(("WM_WININICHANGE\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4203
	    enqEvent(0, hWnd, WM_WININICHANGE, wParam, 0, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4204
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4205
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4206
	case WM_SYSCOLORCHANGE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4207
	    EVENT_PRINTF(("WM_SYSCOLORCHANGE\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4208
	    enqEvent(0, hWnd, WM_SYSCOLORCHANGE, wParam, 0, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4209
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4210
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4211
	case WM_MOVING:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4212
	    DPRINTFIF(__debug_WM_MOVING__ , ("WM_MOVING\n"));
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4213
#ifdef DELAY_ENTER_LEAVE_WHILE_IN_SIZE_MOVE
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4214
	    inMove = 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4215
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4216
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4217
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4218
	case WM_SIZING:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4219
	    EVENT_PRINTF(("WM_SIZING\n"));
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4220
#ifdef DELAY_ENTER_LEAVE_WHILE_IN_SIZE_MOVE
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4221
	    inSize = 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4222
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4223
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4224
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4225
	case WM_ENTERSIZEMOVE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4226
	    EVENT_PRINTF(("WM_ENTERSIZEMOVE\n"));
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4227
#ifdef DELAY_ENTER_LEAVE_WHILE_IN_SIZE_MOVE
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4228
	    inSizeMove = 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4229
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4230
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4231
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4232
	case WM_EXITSIZEMOVE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4233
	    EVENT_PRINTF(("WM_EXITSIZEMOVE\n"));
4155
b557b9991c9c inform STX about WINDOWPOSCHANGED in EXITSIZEMOVE (not during moving)
ca
parents: 4154
diff changeset
  4234
b557b9991c9c inform STX about WINDOWPOSCHANGED in EXITSIZEMOVE (not during moving)
ca
parents: 4154
diff changeset
  4235
#ifndef PRE_13_APR_04_POSCHANGED_IN_EXITSIZEMOVE
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4236
	    if (inMove) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4237
		/* generate WM_WINDOWPOSCHANGED
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4238
		*/
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4239
		RECT rct;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4240
		int x, y, w, h;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4241
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4242
		GetClientRect(hWnd, &rct);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4243
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4244
		x = rct.left;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4245
		y = rct.top;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4246
		w = rct.right - rct.left;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4247
		h = rct.bottom - rct.top;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4248
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4249
		if ((w == 0) && (h == 0)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4250
		    if (! GetWindow_iconified(hWnd)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4251
			SetWindow_iconified(hWnd, 1);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4252
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4253
		    enqEvent(0, hWnd, __WM_ICONIFIED, 1, 0, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4254
		} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4255
		    if (GetWindow_iconified(hWnd)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4256
			SetWindow_iconified(hWnd, 0);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4257
			enqEvent(0, hWnd, __WM_ICONIFIED, 0, 0, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4258
		    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4259
			enqEvent(0, hWnd, WM_WINDOWPOSCHANGED, 0, x, y, w, h, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4260
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4261
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4262
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4263
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4264
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4265
	    inSizeMove = inMove = inSize = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4266
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4267
	    if (needDelayedMouseLeaveWindow || needDelayedMouseEnterWindow) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4268
		int modifiers = getModifiers();
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4269
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4270
		if (needDelayedMouseLeaveWindow) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4271
		    if (GetWindow_eventMask(needDelayedMouseLeaveWindow) & LeaveWindowMask) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4272
			enqEvent(LeaveWindowMask, needDelayedMouseLeaveWindow, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4273
			SetWindow_mouseXY(needDelayedMouseLeaveWindow, -9999, -9999);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4274
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4275
		    needDelayedMouseLeaveWindow = NULL;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4276
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4277
		if (needDelayedMouseEnterWindow) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4278
		    if (GetWindow_eventMask(needDelayedMouseEnterWindow) & EnterWindowMask) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4279
			enqEvent(EnterWindowMask, needDelayedMouseEnterWindow, __WM_MOUSEENTER, 0, delayedMouseEnterX, delayedMouseEnterY, 0, modifiers, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4280
			SetWindow_mouseXY(needDelayedMouseEnterWindow, delayedMouseEnterX, delayedMouseEnterY);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4281
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4282
		    needDelayedMouseEnterWindow = NULL;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4283
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4284
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4285
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4286
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4287
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4288
	case WM_MOVE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4289
	    EVENT_PRINTF(("WM_MOVE\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4290
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4291
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4292
	case WM_POWER:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4293
	    EVENT_PRINTF(("WM_POWER\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4294
	    enqEvent(0, hWnd, WM_POWER, wParam, 0, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4295
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4296
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4297
	/* native widget actions */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4298
	case WM_COMMAND:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4299
	    if (lParam) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4300
		NDPRINTF(("COMMAND for widget\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4301
		enqEvent(0, (HWND)(lParam), WM_COMMAND, wParam, lParam, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4302
	    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4303
		NDPRINTF(("COMMAND for owner\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4304
		enqEvent(0, hWnd, WM_COMMAND, wParam, lParam, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4305
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4306
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4307
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4308
	/* tray action */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4309
	case WM_TRAY_MESSAGE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4310
	    DPRINTF(("tray message hWnd=0x%x lP=0x%x wP=0x%x\n", hWnd, lParam, wParam));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4311
	    enqEvent(0, hWnd, WM_TRAY_MESSAGE, wParam, lParam, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4312
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4313
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4314
	case WM_COPYDATA:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4315
	    DPRINTFIF(__debug_WM_COPYDATA__ , ("WM_COPYDATA\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4316
	    {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4317
		PCOPYDATASTRUCT pCDs;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4318
		int dwData;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4319
		void *pData;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4320
		void *pCopiedData;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4321
		int nBytes;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4322
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4323
		pCDs = (PCOPYDATASTRUCT) lParam;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4324
		dwData = pCDs->dwData;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4325
		nBytes = pCDs->cbData;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4326
		pData = (void *)pCDs->lpData;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4327
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4328
		/*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4329
		 * because pData is only valid here, copy it out to a malloc'd
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4330
		 * area. This MUST be free'd by someone else !
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4331
		 */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4332
		if (nBytes) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4333
		    pCopiedData = malloc(nBytes);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4334
		    memcpy(pCopiedData, pData, nBytes);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4335
		} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4336
		    pCopiedData = NULL;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4337
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4338
		//     (flag, hWnd, message, wParam, arg1, arg2, arg3, arg4, evTime)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4339
		enqEvent(0, hWnd, WM_COPYDATA, wParam, pCopiedData, nBytes, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4340
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4341
	    *pDefault = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4342
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4343
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4344
	case WM_HSCROLL:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4345
	case WM_VSCROLL:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4346
	    NDPRINTF(("VM_*SCROLL\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4347
	    enqEvent(0, hWnd, message, wParam, lParam, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4348
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4349
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4350
	case WM_DRAWITEM:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4351
	    EVENT_PRINTF(("WM_DRAWITEM\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4352
#if 0
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4353
	    {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4354
		DRAWITEMSTRUCT *pItemStruct;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4355
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4356
		pItemStruct = (DRAWITEMSTRUCT *)lParam;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4357
		enqEvent(0, pItemStruct->hwndItem, WM_DRAWITEM, wParam, 0, 0, 0, 0, EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4358
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4359
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4360
	    break;
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
  4361
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
  4362
#ifdef TRACE_ALL_EVENTS
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4363
	case WM_CTLCOLORMSGBOX:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4364
	    UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORMSGBOX\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4365
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4366
	case WM_CTLCOLOREDIT:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4367
	    UNHANDLED_EVENT_PRINTF(("WM_CTLCOLOREDIT\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4368
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4369
	case WM_CTLCOLORLISTBOX:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4370
	    UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORLISTBOX\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4371
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4372
	case WM_CTLCOLORBTN:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4373
	    UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORBTN\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4374
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4375
	case WM_CTLCOLORDLG:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4376
	    UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORDLG\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4377
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4378
	case WM_CTLCOLORSTATIC:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4379
	    UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORSTATIC\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4380
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4381
	case WM_CTLCOLORSCROLLBAR:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4382
	    UNHANDLED_EVENT_PRINTFIF(__debug_WM_CTLCOLORSCROLLBAR__, ("WM_CTLCOLORSCROLLBAR\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4383
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4384
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4385
	case WM_STYLECHANGING:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4386
	    UNHANDLED_EVENT_PRINTF(("WM_STYLECHANGING\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4387
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4388
	case WM_STYLECHANGED:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4389
	    UNHANDLED_EVENT_PRINTF(("WM_STYLECHANGED\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4390
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4391
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4392
	case WM_GETICON:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4393
	    UNHANDLED_EVENT_PRINTFIF(__debug_WM_GETICON__, ("WM_GETICON\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4394
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4395
	case WM_SETICON:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4396
	    UNHANDLED_EVENT_PRINTF(("WM_SETICON\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4397
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4398
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4399
	case WM_PRINT:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4400
	    UNHANDLED_EVENT_PRINTF(("WM_PRINT(lParam=%d)\n", lParam));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4401
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4402
	case WM_PRINTCLIENT:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4403
	    UNHANDLED_EVENT_PRINTF(("WM_PRINTCLIENT(lParam=%d)\n", lParam));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4404
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4405
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4406
	case WM_NULL:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4407
	    UNHANDLED_EVENT_PRINTF(("WM_NULL\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4408
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4409
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4410
	case WM_ENABLE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4411
	    UNHANDLED_EVENT_PRINTF(("WM_ENABLE\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4412
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4413
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4414
	case WM_SETREDRAW:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4415
	    UNHANDLED_EVENT_PRINTF(("WM_SETREDRAW\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4416
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4417
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4418
	case WM_DEVMODECHANGE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4419
	    UNHANDLED_EVENT_PRINTF(("WM_DEVMODECHANGE\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4420
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4421
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4422
	case WM_TIMECHANGE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4423
	    UNHANDLED_EVENT_PRINTF(("WM_TIMECHANGE\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4424
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4425
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4426
	case WM_CANCELMODE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4427
	    UNHANDLED_EVENT_PRINTF(("WM_CANCELMODE\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4428
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4429
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4430
	case WM_CHILDACTIVATE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4431
	    UNHANDLED_EVENT_PRINTF(("WM_CHILDACTIVATE\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4432
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4433
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4434
	case WM_QUEUESYNC:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4435
	    UNHANDLED_EVENT_PRINTF(("WM_QUEUESYNC\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4436
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4437
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4438
	case WM_NEXTDLGCTL:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4439
	    UNHANDLED_EVENT_PRINTF(("WM_NEXTDLGCTL\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4440
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4441
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4442
	case WM_SPOOLERSTATUS:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4443
	    UNHANDLED_EVENT_PRINTF(("WM_SPOOLERSTATUS\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4444
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4445
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4446
	case WM_MEASUREITEM:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4447
	    UNHANDLED_EVENT_PRINTF(("WM_MEASUREITEM\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4448
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4449
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4450
	case WM_DELETEITEM:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4451
	    UNHANDLED_EVENT_PRINTF(("WM_DELETEITEM\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4452
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4453
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4454
	case WM_VKEYTOITEM:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4455
	    UNHANDLED_EVENT_PRINTF(("WM_VKEYTOITEM\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4456
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4457
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4458
	case WM_CHARTOITEM:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4459
	    UNHANDLED_EVENT_PRINTF(("WM_CHARTOITEM\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4460
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4461
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4462
	case WM_SETFONT:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4463
	    UNHANDLED_EVENT_PRINTF(("WM_SETFONT\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4464
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4465
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4466
	case WM_GETFONT:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4467
	    UNHANDLED_EVENT_PRINTF(("WM_GETFONT\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4468
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4469
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4470
	case WM_SETHOTKEY:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4471
	    UNHANDLED_EVENT_PRINTF(("WM_SETHOTKEY\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4472
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4473
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4474
	case WM_GETHOTKEY:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4475
	    UNHANDLED_EVENT_PRINTF(("WM_GETHOTKEY\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4476
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4477
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4478
	case WM_QUERYDRAGICON:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4479
	    UNHANDLED_EVENT_PRINTF(("WM_QUERYDRAGICON\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4480
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4481
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4482
	case WM_COMPAREITEM:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4483
	    UNHANDLED_EVENT_PRINTF(("WM_COMPAREITEM\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4484
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4485
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4486
	case WM_GETOBJECT:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4487
	    UNHANDLED_EVENT_PRINTF(("WM_GETOBJECT\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4488
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4489
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4490
	case WM_COMPACTING:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4491
	    UNHANDLED_EVENT_PRINTF(("WM_COMPACTING\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4492
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4493
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4494
	case WM_COMMNOTIFY:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4495
	    UNHANDLED_EVENT_PRINTF(("WM_COMMNOTIFY\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4496
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4497
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4498
	case WM_CANCELJOURNAL:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4499
	    UNHANDLED_EVENT_PRINTF(("WM_CANCELJOURNAL\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4500
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4501
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4502
	case WM_INPUTLANGCHANGEREQUEST:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4503
	    UNHANDLED_EVENT_PRINTF(("WM_INPUTLANGCHANGEREQUEST\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4504
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4505
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4506
	case WM_INPUTLANGCHANGE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4507
	    UNHANDLED_EVENT_PRINTF(("WM_INPUTLANGCHANGE\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4508
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4509
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4510
	case WM_TCARD:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4511
	    UNHANDLED_EVENT_PRINTF(("WM_TCARD\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4512
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4513
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4514
	case WM_HELP:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4515
	    UNHANDLED_EVENT_PRINTF(("WM_HELP\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4516
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4517
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4518
	case WM_USERCHANGED:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4519
	    UNHANDLED_EVENT_PRINTF(("WM_USERCHANGED\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4520
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4521
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4522
	case WM_NOTIFY:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4523
	    UNHANDLED_EVENT_PRINTF(("WM_NOTIFY\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4524
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4525
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4526
	case WM_NOTIFYFORMAT:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4527
	    UNHANDLED_EVENT_PRINTF(("WM_NOTIFYFORMAT\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4528
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4529
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4530
	case WM_CONTEXTMENU:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4531
	    UNHANDLED_EVENT_PRINTF(("WM_CONTEXTMENU\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4532
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4533
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4534
	case WM_NCXBUTTONDOWN:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4535
	    UNHANDLED_EVENT_PRINTF(("WM_NCXBUTTONDOWN\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4536
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4537
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4538
	case WM_NCXBUTTONUP:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4539
	    UNHANDLED_EVENT_PRINTF(("WM_NCXBUTTONUP\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4540
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4541
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4542
	case WM_NCXBUTTONDBLCLK:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4543
	    UNHANDLED_EVENT_PRINTF(("WM_NCXBUTTONDBLCLK\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4544
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4545
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4546
	case WM_DEVICECHANGE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4547
	    UNHANDLED_EVENT_PRINTF(("WM_DEVICECHANGE\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4548
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4549
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4550
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4551
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4552
	default:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4553
	    EVENT_PRINTF(( "WinWorkstat [info] unhandled msg = %d 0x%x [%d]\n", message, message, __LINE__));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4554
	    break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4555
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4556
    return 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4557
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4558
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4559
LONG APIENTRY
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4560
MainWndProc(HWND hWnd,UINT message,UINT wParam,LONG lParam);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4561
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4562
static void _USERENTRY
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4563
dispatchThread(void *arg)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4564
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4565
    static int th_calls;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4566
    RECT rect;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4567
    MSG msg;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4568
    localWindowInfo *lI;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4569
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4570
    _dispatchThreadId2 = GetCurrentThreadId();
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4571
#ifdef STARTUP_DISPATCHTHREAD_DEBUG
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  4572
    console_fprintf(stderr, "WinWorkstation [info]: dispatchThreadID2=%x\n", _dispatchThreadId2);
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4573
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4574
    TH_DPRINTF(("TS %d\n", th_calls++));
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  4575
    PeekMessageW(&msg, NULL, 0, 0, PM_NOREMOVE);   /* must be */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4576
4444
8d6a48c51edc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  4577
#if 0
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4578
    if (AttachThreadInput(_masterThreadId, _dispatchThreadId2, TRUE) != TRUE) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4579
	console_fprintf(stderr, "WinWorkstation [warning]: AttachThreadInput failed\n");
4443
96e956cf9acf plugin stuff now in librun
Claus Gittinger <cg@exept.de>
parents: 4441
diff changeset
  4580
    };
4444
8d6a48c51edc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  4581
#endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4582
#ifndef WIN32THREADS
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4583
# if 0
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4584
    SetThreadPriority(_masterThread,THREAD_PRIORITY_HIGHEST);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4585
    SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_ABOVE_NORMAL);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4586
# endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4587
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4588
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4589
    GetWindowRect(GetDesktopWindow(), &rect);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4590
    /* allocate localMemory for Window */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4591
    lI = (localWindowInfo *)malloc(sizeof(localWindowInfo));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4592
    if (lI) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4593
	memset(lI, 0, sizeof(*lI));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4594
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4595
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  4596
    __rootWinSpezial = CreateWindowExW(WS_EX_TOOLWINDOW | WS_EX_TRANSPARENT,
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4597
				      wapp_nameRoot, wapp_nameRoot,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4598
				      WS_POPUP | WS_DISABLED,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4599
				      0, 0,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4600
				      rect.right - rect.left, rect.bottom - rect.top,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4601
				      0, 0, (HANDLE) __getHInstance(), lI);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4602
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  4603
    //ShowWindow(__rootWinSpezial,SW_SHOWNOACTIVATE);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  4604
    SetWindowPos(__rootWinSpezial, HWND_BOTTOM, 0, 0, 0, 0,
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4605
		 SWP_NOSENDCHANGING |
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4606
		 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4607
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4608
#ifdef STARTUP_DISPATCHTHREAD_DEBUG
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  4609
    console_fprintf(stderr, "WinWorkstation [info]: setting ThreadRunningEvent\n");
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4610
#endif
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4611
    SetEvent(hDispatchThreadRunningEvent);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4612
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4613
    for (;;) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4614
	HANDLE dummy;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4615
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4616
	TH_DPRINTF(("TG %d\n", th_calls++));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4617
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4618
	/*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4619
	 * if there is no current capture (pointer-grab),
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4620
	 * make certain that we do not get stuck in the GetMessage
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4621
	 * but instead poll the mouse in 200ms intervals.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4622
	 * This is required to synthesize the MOUSELEAVE message,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4623
	 */
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
  4624
DPRINTF(("X1\n"));
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4625
	if (__currentPointerView && (__currentCapture == CAPTURE_NONE)) {
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
  4626
DPRINTF(("X2\n"));
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4627
	    while (PeekMessageW(&msg, 0, 0, 0, PM_NOREMOVE) == 0) {
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
  4628
DPRINTF(("PeekMessage -> 0\n"));
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4629
		/*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4630
		 * wait for an event; timeout after 200 millis
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4631
		 */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4632
		if (MsgWaitForMultipleObjects(0,&dummy,FALSE,200,QS_ALLINPUT) == WAIT_TIMEOUT) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4633
		    if (! inSizeMove) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4634
			/*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4635
			 * timeout - see where mouse pointer is
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4636
			 * for synthetic leave events.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4637
			 */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4638
			POINT point;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4639
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4640
			if (GetCursorPos(&point)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4641
			    HWND hWnd = WindowFromPoint(point);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4642
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4643
			    if (hWnd) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4644
				if (GetWindowThreadProcessId(hWnd,0) != GetCurrentThreadId()) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4645
				    if (inSizeMove) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4646
					if (needDelayedMouseLeaveWindow == NULL) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4647
					    needDelayedMouseLeaveWindow = __currentPointerView;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4648
					}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4649
				    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4650
					if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4651
					    enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers(), EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4652
					    SetWindow_mouseXY(__currentPointerView, -9999, -9999);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4653
					}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4654
				    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4655
				    __currentPointerView = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4656
				    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4657
				}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4658
			    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4659
			}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4660
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4661
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4662
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4663
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4664
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4665
	GetMessageW(&msg, NULL, 0, 0);
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
  4666
DPRINTF(("GetMessage -> %d\n", msg.message));
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4667
	TH_DPRINTF(("TD %d\n", th_calls++));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4668
	destroyWin = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4669
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4670
	switch (msg.message) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4671
#if 0
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4672
	    case WM_THREAD_DESTROYWINDOW:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4673
		destroyWin = TRUE;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4674
		msg.message = WM_CLOSE;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4675
		EVENT_PRINTF(("thread WM_THREAD_DESTROYWINDOW %x\n",msg.hwnd));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4676
		break;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4677
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4678
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4679
#ifdef SET_FOCUS_IN_WINTHREAD
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4680
	    case WM_THREAD_SETFOCUS:
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4681
# ifdef xxWIN32THREADS
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4682
		if (msg.lParam) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4683
		    if (AttachThreadInput(_dispatchThreadId2,msg.lParam,TRUE) == FALSE)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4684
			PRINTF(("SetFocus AttachThreadInput error %d\n", GetLastError()));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4685
		}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4686
# endif
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4687
		EVENT_PRINTF(("threadSetfocus %x\n",msg.wParam));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4688
		if (SetFocus((HWND)msg.wParam) == 0) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4689
		    DDPRINTF(("SetFocus to %x failed.\n",msg.wParam));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4690
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4691
		continue;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4692
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4693
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4694
#ifdef SET_CURSOR_IN_WINTHREAD
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4695
	    case WM_THREAD_SETCURSOR:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4696
		if (msg.lParam) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4697
		    if( __isWinNT_NEW_BEHAVIOUR ) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4698
			SetCursor((HCURSOR)msg.lParam);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4699
		    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4700
			POINT p;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4701
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4702
			GetCursorPos(&p);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4703
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4704
			if (WindowFromPoint(p) == msg.hwnd) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4705
			    EVENT_PRINTF(("threadSetCursor %x\n",msg.lParam));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4706
			    SetCursor((HCURSOR)msg.lParam);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4707
			}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4708
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4709
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4710
		continue;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4711
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4712
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  4713
#ifdef BEEP_IN_WINTHREAD
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4714
	    case WM_THREAD_BEEP:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4715
		MessageBeep( MB_ICONEXCLAMATION);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4716
		continue;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4717
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4718
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4719
	    case WM_THREAD_SETCAPTURE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4720
		if (msg.wParam) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4721
		    if (__currentPointerView) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4722
			if (inSizeMove) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4723
			    if (needDelayedMouseLeaveWindow == NULL) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4724
				needDelayedMouseLeaveWindow = __currentPointerView;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4725
			    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4726
			} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4727
			    if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4728
				enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers(), EV_NOTIME);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4729
				SetWindow_mouseXY(__currentPointerView, -9999, -9999);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4730
			    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4731
			}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4732
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4733
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4734
		    __currentPointerView = (HWND)msg.wParam;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4735
		    __currentCapture = CAPTURE_EXPLICIT;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4736
		    EVENT_PRINTF(("threadSetCapture %x\n",msg.wParam));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4737
		    SetCapture(__currentPointerView);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4738
		} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4739
		    if (__currentPointerView  == __rootWinSpezial) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4740
			//ShowWindow(__rootWinSpezial, SW_HIDE);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4741
			SetWindowPos(__rootWinSpezial, HWND_BOTTOM, 0, 0, 0, 0,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4742
				     SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4743
				     | SWP_HIDEWINDOW | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4744
				   /*| SWP_NOZORDER | SWP_NOOWNERZORDER */);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4745
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4746
		    __currentPointerView = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4747
		    __currentCapture = CAPTURE_NONE;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4748
		    EVENT_PRINTF(("threadReleaseCapture\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4749
		    ReleaseCapture();
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4750
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4751
		if (msg.lParam) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4752
		    DDPRINTF(("threadSetCursor %x\n",msg.lParam));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4753
		    SetCursor((HCURSOR)msg.lParam);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4754
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4755
		continue;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4756
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4757
	    case WM_THREAD_CREATEWINDOW:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4758
		EVENT_PRINTF(("*WM_THREAD_CREATEWINDOW %d\n", th_calls));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4759
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4760
		{
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4761
		    createWindowInfo *cwi = (createWindowInfo *)(msg.lParam);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4762
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4763
		    if ((cwi->sequenceNr == msg.wParam)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4764
		     && (cwi->sequenceNr != INVALIDATED_CWI)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4765
			cwi->sequenceNr = INVALIDATED_CWI;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4766
			cwi->infoWasRead = 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4767
			if (cwi->newWinHandle == NULL) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4768
			    HANDLE ev;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4769
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4770
			    cwi->newWinHandle = CreateWindowExW(
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4771
						cwi->winStyleBitsEx,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4772
						cwi->className,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4773
						cwi->windowName,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4774
						cwi->winStyleBits,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4775
						cwi->x, cwi->y,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4776
						cwi->dx, cwi->dy,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4777
						cwi->parentHandle,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4778
						NULL,           /* menu */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4779
						(HANDLE) __getHInstance(),
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4780
						cwi->localWindowInfo
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4781
					       );
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4782
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4783
			    if (cwi->newWinHandle == NULL) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4784
				cwi->errCode = GetLastError();
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4785
				console_fprintf(stderr, "WinWorkstation [info]: CreateWindow %s failed: %d (0x%x) [%d]\n",
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4786
						cwi->className, cwi->errCode, cwi->errCode, __LINE__);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4787
			    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4788
				SETLOCALWINDOWINFOPTR(cwi->newWinHandle, cwi->localWindowInfo);
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  4789
#ifdef DEBUG /* PARANOIA */
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4790
				if (GETLOCALWINDOWINFOPTR(cwi->newWinHandle) != cwi->localWindowInfo) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4791
				   console_fprintf(stderr, "lI-Error\n");
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4792
				}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4793
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4794
			    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4795
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4796
			    ev = cwi->hCreateEvent;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4797
			    if (ev) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4798
				SetEvent(ev);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4799
			    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4800
			}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4801
		    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4802
			DPRINTF(("obsolete createWindow message %x ignored\n", cwi->sequenceNr));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4803
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4804
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4805
		continue;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4806
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4807
	    case WM_KEYDOWN:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4808
		DPRINTFIF(__debug_WM_KEYDOWN__ , ("WM_KEYDOWN %x\n", msg.wParam));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4809
		goto commonKey;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4810
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4811
	    case WM_KEYUP:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4812
		DPRINTFIF(__debug_WM_KEYUP__  , ("WM_KEYUP %x\n", msg.wParam));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4813
		goto commonKey;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4814
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4815
	    case WM_SYSKEYDOWN:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4816
		DPRINTFIF(__debug_WM_KEYDOWN__ , ("WM_SYSKEYDOWN %x\n", msg.wParam));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4817
		goto commonKey;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4818
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4819
	    case WM_SYSKEYUP:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4820
		DPRINTFIF(__debug_WM_KEYUP__ , ("WM_SYSKEYUP %x\n", msg.wParam));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4821
		goto commonKey;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4822
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4823
	    commonKey:
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
  4824
#if 1
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4825
		if (((msg.wParam >= '0') && (msg.wParam <= 'Z'))
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4826
		 || ((msg.wParam >= VK_MULTIPLY) && (msg.wParam <= VK_DIVIDE))
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4827
		 || (msg.wParam == VK_SPACE)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4828
		 || (msg.wParam == VK_CAPITAL)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4829
		 /* || (msg.wParam == VK_SHIFT) */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4830
		 || (msg.wParam >= 0xB0))
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4831
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4832
		{
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4833
		    /*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4834
		     * translate to a WM_CHAR message
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4835
		     */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4836
		    if (TranslateMessage(&msg))
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4837
			continue;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4838
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4839
		break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4840
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4841
	    /* short cirquit some messages */
3574
db1360ba8dea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3573
diff changeset
  4842
#if 0
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  4843
#ifndef SUPPORT_NATIVE_WINDOWS
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4844
	    /*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4845
	     * some can simply be ignored ...
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4846
	     */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4847
	    case WM_ERASEBKGND:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4848
		EVENT_PRINTF(("*WM_ERASEBKGND\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4849
		continue;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4850
	    case WM_KILLFOCUS:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4851
		EVENT_PRINTF(("*WM_KILLFOCUS\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4852
		continue;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4853
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4854
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4855
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4856
#if 0
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4857
	    case WM_SIZE:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4858
		EVENT_PRINTF(("*WM_SIZE\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4859
		continue;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4860
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4861
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4862
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4863
	/*
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4864
	 * common ...
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4865
	 */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4866
	evRootX = msg.pt.x;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4867
	evRootY = msg.pt.y;
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  4868
#if 1
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4869
	{
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4870
	    POINT p;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4871
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4872
	    if (GetCursorPos(&p)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4873
		evRootX = p.x;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4874
		evRootY = p.y;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4875
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4876
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4877
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4878
	lastMSGTime = msg.time;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4879
	DispatchMessageW(&msg);   /* Dispatches message to window */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4880
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4881
}
1127
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
LONG APIENTRY
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  4884
MainWndProc(HWND hWnd, UINT message, UINT wParam, LONG lParam)
1127
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
    int wantDefault = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4887
    int retVal;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4888
    createWindowInfo *cwi;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4889
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4890
    TH_DPRINTF(("TMW %d\n",message));
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
  4891
DPRINTF(("MainWndProc %d\n",message));
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4892
    /*
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4893
     * kludge while in sizeMove loop, which
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4894
     * is performed directly by DefWindowProc
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  4895
     * 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
  4896
     * 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
  4897
     */
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
  4898
    cwi = pendingCREATEWINDOWInfo;
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
  4899
    if (cwi) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4900
	int dummyWantDefault;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4901
	int seqNr = pendingSequenceNr;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4902
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4903
	pendingCREATEWINDOWInfo = 0;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4904
	pendingSequenceNr = INVALIDATED_CWI;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4905
	DPRINTF(("### THREAD_CREATEWINDOW\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4906
	winEventProcessing(0, WM_THREAD_CREATEWINDOW, seqNr, cwi, &dummyWantDefault);
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4907
    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4908
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4909
    retVal = winEventProcessing(hWnd, message, wParam, lParam, &wantDefault);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4910
    if (wantDefault) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4911
	DDPRINTF((">>DefWindowProc\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4912
	retVal = DefWindowProcW(hWnd, message, wParam, lParam);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4913
	DDPRINTF(("<<DefWindowProc\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4914
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4915
    return retVal;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4916
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4917
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4918
static int CALLBACK
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4919
EnumWindowsProc( hwnd, lParam )
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4920
	HWND            hwnd;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4921
	LPARAM          lParam;
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4922
{
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4923
	OBJ *refToCollection;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4924
	OBJ collection;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4925
	OBJ wHandle;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4926
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4927
	if (hwnd) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4928
	    refToCollection = (OBJ*) lParam;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4929
	    __PROTECT__(*refToCollection);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4930
	    wHandle = __MKEXTERNALADDRESS(hwnd);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4931
	    __UNPROTECT__(*refToCollection);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4932
	    collection = *refToCollection;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4933
	    __SSEND1( collection, @symbol(add:), 0, wHandle );
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4934
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4935
	return TRUE;
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4936
}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4937
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4938
#define xxUSE_EnumFontFamiliesEx
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4939
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4940
static int CALLBACK
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4941
EnumFPTypeFaceProc( lplf, lptm, dwType, lpData )
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4942
#ifdef USE_EnumFontFamiliesEx
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4943
	ENUMLOGFONTEX   *lplf;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4944
#else
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4945
	LOGFONT         *lplf;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4946
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4947
	TEXTMETRIC      *lptm;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4948
	DWORD           dwType;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4949
	LPARAM          lpData;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4950
{
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4951
	OBJ t;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4952
	OBJ *refToList;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4953
	OBJ  typeFaceList;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4954
	char *faceNameString;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4955
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4956
	if (lplf) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4957
	    refToList = (OBJ*) lpData;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4958
	    __PROTECT__(*refToList);
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4959
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4960
#ifdef USE_EnumFontFamiliesEx
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4961
	    faceNameString = lplf->elfLogFont.lfFaceName;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4962
#else
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4963
	    faceNameString = lplf->lfFaceName;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4964
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4965
	    t = __MKSTRING( faceNameString );
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4966
	    __UNPROTECT__(*refToList);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4967
	    typeFaceList = *refToList;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4968
	    __SSEND1( typeFaceList, @symbol(add:), 0, t );
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4969
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  4970
	return 1;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4971
}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4972
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4973
/*
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4974
 * take a LOGFONT structure and extract relevant data into a smalltalk array.
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4975
 *
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4976
 * Returned value is:
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4977
 *      #(
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4978
 *          1   lfHeight
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4979
 *          2   lfWidth
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4980
 *          3   lfEscapement
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4981
 *          4   lfOrientation
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4982
 *          5   lfWeight (Integer)
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4983
 *          6   lfWeight (String)
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4984
 *          7   lfItalic
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4985
 *          8   lfUnderline
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4986
 *          9   lfStrikeOut
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4987
 *         10   lfCharSet (Integer)
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4988
 *         11   lfOutPrecision
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4989
 *         12   lfClipPrecision
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4990
 *         13   lfQuality
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4991
 *         14   lfPitchAndFamily
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4992
 *         15   face and style name (String i.e. "bold-roman")
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4993
 *         16   face name from windows
4014
Claus Gittinger <cg@exept.de>
parents: 4013
diff changeset
  4994
 *         17   character encoding lfCharSet (as String i.e. "ms_ansi", "ms_oem", "ms_cyrillic")
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4995
 *         18
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4996
 *         19
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4997
 *         20
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4998
 *       )
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4999
 * 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
  5000
 */
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  5001
OBJ
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5002
__charSetSymbolFor(charSet)
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5003
{
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5004
    char *s;
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5005
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5006
    switch (charSet) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5007
	case ANSI_CHARSET:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5008
	    s = "ms-ansi";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5009
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5010
	case DEFAULT_CHARSET:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5011
	    s = "ms-default";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5012
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5013
	case SYMBOL_CHARSET:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5014
	    s = "ms-symbol";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5015
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5016
	case SHIFTJIS_CHARSET:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5017
	    s = "ms-shiftjis";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5018
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5019
	case GB2312_CHARSET:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5020
	    s = "ms-gb2312";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5021
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5022
	case HANGEUL_CHARSET:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5023
	    s = "ms-hangeul";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5024
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5025
# if defined(HANGUL_CHARSET) && (HANGUL_CHARSET != HANGEUL_CHARSET)
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5026
	case HANGUL_CHARSET:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5027
	    s = "ms-hangul";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5028
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5029
# endif
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5030
	case CHINESEBIG5_CHARSET:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5031
	    s = "ms-chinesebig5";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5032
	    break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5033
	case OEM_CHARSET:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5034
	    s = "ms-oem";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5035
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5036
# ifdef JOHAB_CHARSET
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5037
	case JOHAB_CHARSET:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5038
	    s = "ms-johab";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5039
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5040
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5041
# ifdef HEBREW_CHARSET
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5042
	case HEBREW_CHARSET:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5043
	    s = "ms-hebrew";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5044
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5045
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5046
# ifdef ARABIC_CHARSET
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5047
	case ARABIC_CHARSET:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5048
	    s = "ms-arabic";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5049
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5050
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5051
# ifdef GREEK_CHARSET
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5052
	case GREEK_CHARSET:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5053
	    s = "ms-greek";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5054
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5055
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5056
# ifdef TURKISH_CHARSET
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5057
	case TURKISH_CHARSET:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5058
	    s = "ms-turkish";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5059
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5060
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5061
# ifdef RUSSIAN_CHARSET
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5062
	case RUSSIAN_CHARSET:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5063
	    s = "ms-russian";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5064
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5065
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5066
# ifdef EASTEUROPE_CHARSET
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5067
	case EASTEUROPE_CHARSET:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5068
	    s = "ms-easteurope";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5069
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5070
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5071
# ifdef BALTIC_CHARSET
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5072
	case BALTIC_CHARSET:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5073
	    s = "ms-baltic";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5074
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5075
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5076
# ifdef VIETNAMESE_CHARSET
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5077
	case VIETNAMESE_CHARSET:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5078
	    s = "ms-vietnamese";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5079
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5080
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5081
# ifdef THAI_CHARSET
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5082
	case THAI_CHARSET:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5083
	    s = "ms-thai";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5084
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5085
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5086
# ifdef MAC_CHARSET
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5087
	case MAC_CHARSET:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5088
	    s = "ms-mac";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5089
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5090
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5091
# ifdef UNICODE_CHARSET
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5092
	case UNICODE_CHARSET:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5093
	    s = "ms-unicode";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5094
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5095
# endif
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5096
	default:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5097
	    s = "unknown";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5098
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5099
    }
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5100
    return __MKSYMBOL(s, 0);
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5101
}
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5102
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  5103
OBJ
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  5104
__extractLogicalFontParameters(lplf)
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5105
	LOGFONT         *lplf;     /* ptr of logical-font data */
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  5106
{
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5107
	OBJ newArray, t;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5108
	char *s;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5109
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5110
	DPRINTF((" lfHeight          %d\n", lplf->lfHeight ));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5111
	DPRINTF((" lfWidth           %d\n", lplf->lfWidth  ));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5112
	DPRINTF((" lfEscapement      %d\n", lplf->lfEscapement  ));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5113
	DPRINTF((" lfOrientation     %d\n", lplf->lfOrientation  ));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5114
	DPRINTF((" lfWeight          %d\n", lplf->lfWeight  ));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5115
	DPRINTF((" lfItalic          %d\n", lplf->lfItalic  ));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5116
	DPRINTF((" lfUnderline       %d\n", lplf->lfUnderline  ));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5117
	DPRINTF((" lfStrikeOut       %d\n", lplf->lfStrikeOut  ));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5118
	DPRINTF((" lfCharSet         %d\n", lplf->lfCharSet  ));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5119
	DPRINTF((" lfOutPrecision    %d\n", lplf->lfOutPrecision  ));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5120
	DPRINTF((" lfClipPrecision   %d\n", lplf->lfClipPrecision  ));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5121
	DPRINTF((" lfQuality         %d\n", lplf->lfQuality  ));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5122
	DPRINTF((" lfPitchAndFamily  %d\n", lplf->lfPitchAndFamily  ));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5123
	DPRINTF((" lfFaceName        %s\n\n", lplf->lfFaceName  ));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5124
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5125
	newArray = __ARRAY_NEW_INT(20);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5126
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5127
	__ArrayInstPtr(newArray)->a_element[0] = __MKSMALLINT(lplf->lfHeight);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5128
	__ArrayInstPtr(newArray)->a_element[1] = __MKSMALLINT(lplf->lfWidth);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5129
	__ArrayInstPtr(newArray)->a_element[2] = __MKSMALLINT(lplf->lfEscapement);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5130
	__ArrayInstPtr(newArray)->a_element[3] = __MKSMALLINT(lplf->lfOrientation);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5131
	__ArrayInstPtr(newArray)->a_element[4] = __MKSMALLINT(lplf->lfWeight);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5132
	switch (lplf->lfWeight) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5133
	    case FW_HEAVY:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5134
	    case FW_EXTRABOLD:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5135
	    case FW_SEMIBOLD:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5136
	    case FW_BOLD:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5137
		s = "bold";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5138
		break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5139
	    case FW_NORMAL:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5140
#if 0
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5141
		s = "normal";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5142
		break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5143
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5144
	    case FW_MEDIUM:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5145
		s = "medium";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5146
		break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5147
	    case FW_THIN:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5148
	    case FW_EXTRALIGHT:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5149
	    case FW_LIGHT:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5150
		s = "demi";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5151
		break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5152
	    default:
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5153
		s = "other";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5154
		break;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5155
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5156
	__PROTECT__(newArray);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5157
	t = __MKSTRING(s);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5158
	__UNPROTECT__(newArray);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5159
	__ArrayInstPtr(newArray)->a_element[5] = t; __STORE(newArray, t);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5160
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5161
	__ArrayInstPtr(newArray)->a_element[6] = __MKSMALLINT(lplf->lfItalic);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5162
	__ArrayInstPtr(newArray)->a_element[7] = __MKSMALLINT(lplf->lfUnderline);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5163
	__ArrayInstPtr(newArray)->a_element[8] = __MKSMALLINT(lplf->lfStrikeOut);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5164
	__ArrayInstPtr(newArray)->a_element[9] = __MKSMALLINT(lplf->lfCharSet);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5165
	__ArrayInstPtr(newArray)->a_element[10] = __MKSMALLINT(lplf->lfOutPrecision);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5166
	__ArrayInstPtr(newArray)->a_element[11] = __MKSMALLINT(lplf->lfClipPrecision);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5167
	__ArrayInstPtr(newArray)->a_element[12] = __MKSMALLINT(lplf->lfQuality);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5168
	__ArrayInstPtr(newArray)->a_element[13] = __MKSMALLINT(lplf->lfPitchAndFamily);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5169
	/* ... */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5170
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5171
	if( lplf->lfItalic == TRUE ) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5172
	    if( lplf->lfUnderline == TRUE ) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5173
		if( lplf->lfStrikeOut == TRUE ) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5174
		    s = "italic-underline-strikeOut";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5175
		} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5176
		    s = "italic-underline";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5177
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5178
	    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5179
		if( lplf->lfStrikeOut == TRUE ) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5180
		    s = "italic-strikeOut";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5181
		} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5182
		    s = "italic";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5183
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5184
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5185
	} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5186
	    if( lplf->lfUnderline == TRUE ) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5187
		if( lplf->lfStrikeOut == TRUE ) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5188
		    s = "roman-underline-strikeOut";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5189
		} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5190
		    s = "roman-underline";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5191
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5192
	    } else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5193
		if( lplf->lfStrikeOut == TRUE ) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5194
		    s = "roman-strikeOut";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5195
		} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5196
		    s = "roman";
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5197
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5198
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5199
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5200
	__PROTECT__(newArray);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5201
	t = __MKSYMBOL(s, 0);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5202
	__UNPROTECT__(newArray);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5203
	__ArrayInstPtr(newArray)->a_element[14] = t; __STORE(newArray, t);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5204
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5205
	__PROTECT__(newArray);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5206
	t = __MKSTRING(lplf->lfFaceName);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5207
	__UNPROTECT__(newArray);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5208
	__ArrayInstPtr(newArray)->a_element[15] = t; __STORE(newArray, t);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5209
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5210
	__PROTECT__(newArray);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5211
	t = __charSetSymbolFor(lplf->lfCharSet);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5212
	__UNPROTECT__(newArray);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5213
	__ArrayInstPtr(newArray)->a_element[16] = t; __STORE(newArray, t);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5214
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5215
	return newArray;
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  5216
}
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  5217
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5218
static int CALLBACK
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5219
EnumFontsProc( lplf, lptm, dwType, lpData )
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  5220
#ifdef USE_EnumFontFamiliesEx
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5221
	ENUMLOGFONTEX   *lplf;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5222
#else
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5223
	LOGFONT         *lplf;     /* ptr to of logical-font data */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5224
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5225
	TEXTMETRIC      *lptm;     /* ptr to physical font data */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5226
	DWORD           dwType;    /* font type */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5227
	LPARAM          lpData;    /* application supplied data */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5228
{
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5229
	OBJ *refToList;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5230
	OBJ list;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5231
	OBJ infoArray;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5232
	OBJ *fullName;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5233
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5234
	DPRINTF(("EnumFontsProc\n"));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5235
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5236
	if ( lplf ) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5237
	    refToList = (OBJ*) lpData;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5238
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5239
	    __PROTECT__(*refToList);
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  5240
#ifdef USE_EnumFontFamiliesEx
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5241
	    infoArray = __extractLogicalFontParameters(lplf->elfLogFont);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5242
	    __PROTECT__(infoArray);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5243
	    fullName = __MKSTRING(lplf->elfFullName);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5244
	    __UNPROTECT__(infoArray);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5245
	    __ArrayInstPtr(infoArray)->a_element[17] = fullName; __STORE(infoArray, fullName);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5246
#else
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5247
	    infoArray = __extractLogicalFontParameters(lplf);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5248
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5249
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5250
	    __UNPROTECT__(*refToList);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5251
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5252
	    if ( dwType & TRUETYPE_FONTTYPE ) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5253
		/* change height to 0 to mark variable fonts */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5254
		__ArrayInstPtr(infoArray)->a_element[0] = __MKSMALLINT(0);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5255
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5256
	    list = *refToList;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5257
	    __SSEND1(list, @symbol(add:), 0, infoArray);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5258
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  5259
	return 1;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5260
}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5261
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5262
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5263
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5264
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5265
!WinWorkstation class methodsFor:'documentation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5266
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5267
copyright
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5268
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5269
COPYRIGHT (c) 1996 by Claus Gittinger
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5270
	      All Rights Reserved
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5271
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5272
 This software is furnished under a license and may be used
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5273
 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
  5274
 inclusion of the above copyright notice.   This software may not
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5275
 be provided or otherwise made available to, or used by, any
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5276
 other person.  No title to or ownership of the software is
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5277
 hereby transferred.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5278
"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5279
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5280
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5281
documentation
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5282
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5283
    See more documentation in my superclass, DeviceWorkstation.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5284
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5285
    [author:]
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  5286
	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
  5287
	Manfred Dierolf (many, many changes & fixes, multithreading etc.)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5288
"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5289
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5290
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5291
!WinWorkstation class methodsFor:'initialization'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5292
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5293
initialize
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5294
    super initialize.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5295
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5296
    self initializeStandardColorNames.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5297
4261
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  5298
    NativeWidgets := NativeDialogs := false.
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5299
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  5300
    BeepDuration := 200.        "milliseconds"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5301
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5302
    ButtonTranslation := #(1 2 2).
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5303
3574
db1360ba8dea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3573
diff changeset
  5304
    "/ SysColorChanges are reported *very* often when exceed is running,
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  5305
    "/ 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
  5306
    "/ I dont know what exceed is doing there ...
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  5307
    "/ IgnoreSysColorChanges := true.
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  5308
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5309
    "/ translation table from ST/X windowType symbol (system-independent)
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5310
    "/ to Windows windowClass (windows-specific).
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5311
4261
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  5312
    NativeWidgetClassTable := IdentityDictionary new.
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  5313
    NativeWidgetClassTable at:#ScrollBar                put:'SCROLLBAR'.
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  5314
    NativeWidgetClassTable at:#HorizontalScrollBar      put:'SCROLLBAR'.
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  5315
    NativeWidgetClassTable at:#VerticalScrollBar        put:'SCROLLBAR'.
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  5316
    NativeWidgetClassTable at:#CheckBox                 put:'BUTTON'.
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  5317
    NativeWidgetClassTable at:#RadioButton              put:'BUTTON'.
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  5318
    NativeWidgetClassTable at:#Button                   put:'BUTTON'.
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  5319
    NativeWidgetClassTable at:#DefaultButton            put:'BUTTON'.
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  5320
    NativeWidgetClassTable at:#OwnerDrawButton          put:'BUTTON'.
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  5321
    NativeWidgetClassTable at:#ComboBox                 put:'COMBOBOX'.
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  5322
    NativeWidgetClassTable at:#EditField                put:'EDIT'.
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  5323
    NativeWidgetClassTable at:#ListBox                  put:'LISTBOX'.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5324
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5325
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5326
initializeStandardColorNames
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5327
    "{ Pragma: +optSpace }"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5328
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5329
    "setup standard color names (X-color names)"
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5330
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5331
    StandardColorValues := Dictionary new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5332
    #(
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5333
	(240 248 255)   'aliceblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5334
	(250 235 215)   'antiquewhite'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5335
	(255 239 219)   'AntiqueWhite1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5336
	(238 223 204)   'AntiqueWhite2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5337
	(205 192 176)   'AntiqueWhite3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5338
	(139 131 120)   'AntiqueWhite4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5339
	(127 255 212)   'aquamarine'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5340
	(127 255 212)   'aquamarine1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5341
	(118 238 198)   'aquamarine2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5342
	(102 205 170)   'aquamarine3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5343
	( 69 139 116)   'aquamarine4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5344
	(240 255 255)   'azure'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5345
	(240 255 255)   'azure1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5346
	(224 238 238)   'azure2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5347
	(193 205 205)   'azure3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5348
	(131 139 139)   'azure4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5349
	(245 245 220)   'beige'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5350
	(255 228 196)   'bisque'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5351
	(255 228 196)   'bisque1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5352
	(238 213 183)   'bisque2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5353
	(205 183 158)   'bisque3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5354
	(139 125 107)   'bisque4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5355
	(  0   0   0)   'black'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5356
	(255 235 205)   'blanchedalmond'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5357
	(  0   0 255)   'blue'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5358
	(138  43 226)   'blueviolet'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5359
	(  0   0 255)   'blue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5360
	(  0   0 238)   'blue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5361
	(  0   0 205)   'blue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5362
	(  0   0 139)   'blue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5363
	(165  42  42)   'brown'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5364
	(255  64  64)   'brown1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5365
	(238  59  59)   'brown2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5366
	(205  51  51)   'brown3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5367
	(139  35  35)   'brown4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5368
	(222 184 135)   'burlywood'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5369
	(255 211 155)   'burlywood1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5370
	(238 197 145)   'burlywood2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5371
	(205 170 125)   'burlywood3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5372
	(139 115  85)   'burlywood4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5373
	( 95 158 160)   'cadetblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5374
	(152 245 255)   'CadetBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5375
	(142 229 238)   'CadetBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5376
	(122 197 205)   'CadetBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5377
	( 83 134 139)   'CadetBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5378
	(127 255   0)   'chartreuse'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5379
	(127 255   0)   'chartreuse1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5380
	(118 238   0)   'chartreuse2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5381
	(102 205   0)   'chartreuse3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5382
	( 69 139   0)   'chartreuse4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5383
	(210 105  30)   'chocolate'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5384
	(255 127  36)   'chocolate1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5385
	(238 118  33)   'chocolate2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5386
	(205 102  29)   'chocolate3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5387
	(139  69  19)   'chocolate4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5388
	(255 127  80)   'coral'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5389
	(255 114  86)   'coral1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5390
	(238 106  80)   'coral2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5391
	(205  91  69)   'coral3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5392
	(139  62  47)   'coral4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5393
	(100 149 237)   'cornflowerblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5394
	(255 248 220)   'cornsilk'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5395
	(255 248 220)   'cornsilk1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5396
	(238 232 205)   'cornsilk2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5397
	(205 200 177)   'cornsilk3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5398
	(139 136 120)   'cornsilk4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5399
	(  0 255 255)   'cyan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5400
	(  0 255 255)   'cyan1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5401
	(  0 238 238)   'cyan2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5402
	(  0 205 205)   'cyan3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5403
	(  0 139 139)   'cyan4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5404
	(  0   0 139)   'darkblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5405
	(  0 139 139)   'darkcyan'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5406
	(184 134  11)   'darkgoldenrod'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5407
	(169 169 169)   'darkgray'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5408
	(  0 100   0)   'darkgreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5409
	(169 169 169)   'darkgrey'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5410
	(189 183 107)   'darkkhaki'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5411
	(139   0 139)   'darkmagenta'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5412
	( 85 107  47)   'darkolivegreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5413
	(255 140   0)   'darkorange'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5414
	(153  50 204)   'darkorchid'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5415
	(139   0   0)   'darkred'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5416
	(233 150 122)   'darksalmon'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5417
	(143 188 143)   'darkseagreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5418
	( 72  61 139)   'darkslateblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5419
	( 47  79  79)   'darkslategray'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5420
	( 47  79  79)   'darkslategrey'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5421
	(  0 206 209)   'darkturquoise'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5422
	(148   0 211)   'darkviolet'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5423
	(255 185  15)   'DarkGoldenrod1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5424
	(238 173  14)   'DarkGoldenrod2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5425
	(205 149  12)   'DarkGoldenrod3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5426
	(139 101   8)   'DarkGoldenrod4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5427
	(202 255 112)   'DarkOliveGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5428
	(188 238 104)   'DarkOliveGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5429
	(162 205  90)   'DarkOliveGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5430
	(110 139  61)   'DarkOliveGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5431
	(255 127   0)   'DarkOrange1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5432
	(238 118   0)   'DarkOrange2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5433
	(205 102   0)   'DarkOrange3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5434
	(139  69   0)   'DarkOrange4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5435
	(191  62 255)   'DarkOrchid1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5436
	(178  58 238)   'DarkOrchid2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5437
	(154  50 205)   'DarkOrchid3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5438
	(104  34 139)   'DarkOrchid4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5439
	(193 255 193)   'DarkSeaGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5440
	(180 238 180)   'DarkSeaGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5441
	(155 205 155)   'DarkSeaGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5442
	(105 139 105)   'DarkSeaGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5443
	(151 255 255)   'DarkSlateGray1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5444
	(141 238 238)   'DarkSlateGray2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5445
	(121 205 205)   'DarkSlateGray3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5446
	( 82 139 139)   'DarkSlateGray4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5447
	(255  20 147)   'deeppink'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5448
	(  0 191 255)   'deepskyblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5449
	(255  20 147)   'DeepPink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5450
	(255  20 147)   'DeepPink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5451
	(238  18 137)   'DeepPink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5452
	(205  16 118)   'DeepPink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5453
	(139  10  80)   'DeepPink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5454
	(  0 191 255)   'DeepSkyBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5455
	(  0 178 238)   'DeepSkyBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5456
	(  0 154 205)   'DeepSkyBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5457
	(  0 104 139)   'DeepSkyBlue4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5458
	(105 105 105)   'dimgray'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5459
	(105 105 105)   'dimgrey'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5460
	( 30 144 255)   'dodgerblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5461
	( 30 144 255)   'DodgerBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5462
	( 28 134 238)   'DodgerBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5463
	( 24 116 205)   'DodgerBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5464
	( 16  78 139)   'DodgerBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5465
	(178  34  34)   'firebrick'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5466
	(255  48  48)   'firebrick1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5467
	(238  44  44)   'firebrick2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5468
	(205  38  38)   'firebrick3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5469
	(139  26  26)   'firebrick4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5470
	(255 250 240)   'floralwhite'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5471
	( 34 139  34)   'forestgreen'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5472
	(220 220 220)   'gainsboro'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5473
	(248 248 255)   'ghostwhite'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5474
	(255 215   0)   'gold'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5475
	(255 215   0)   'gold1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5476
	(238 201   0)   'gold2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5477
	(205 173   0)   'gold3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5478
	(139 117   0)   'gold4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5479
	(218 165  32)   'goldenrod'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5480
	(255 193  37)   'goldenrod1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5481
	(238 180  34)   'goldenrod2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5482
	(205 155  29)   'goldenrod3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5483
	(139 105  20)   'goldenrod4'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5484
	(192 192 192)   'grey'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5485
	(  0   0   0)   'grey0'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5486
	(  3   3   3)   'grey1'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5487
	( 26  26  26)   'grey10'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5488
	(255 255 255)   'grey100'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5489
	( 28  28  28)   'grey11'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5490
	( 31  31  31)   'grey12'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5491
	( 33  33  33)   'grey13'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5492
	( 36  36  36)   'grey14'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5493
	( 38  38  38)   'grey15'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5494
	( 41  41  41)   'grey16'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5495
	( 43  43  43)   'grey17'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5496
	( 46  46  46)   'grey18'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5497
	( 48  48  48)   'grey19'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5498
	(  5   5   5)   'grey2'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5499
	( 51  51  51)   'grey20'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5500
	( 54  54  54)   'grey21'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5501
	( 56  56  56)   'grey22'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5502
	( 59  59  59)   'grey23'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5503
	( 61  61  61)   'grey24'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5504
	( 64  64  64)   'grey25'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5505
	( 66  66  66)   'grey26'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5506
	( 69  69  69)   'grey27'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5507
	( 71  71  71)   'grey28'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5508
	( 74  74  74)   'grey29'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5509
	(  8   8   8)   'grey3'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5510
	( 77  77  77)   'grey30'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5511
	( 79  79  79)   'grey31'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5512
	( 82  82  82)   'grey32'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5513
	( 84  84  84)   'grey33'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5514
	( 87  87  87)   'grey34'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5515
	( 89  89  89)   'grey35'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5516
	( 92  92  92)   'grey36'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5517
	( 94  94  94)   'grey37'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5518
	( 97  97  97)   'grey38'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5519
	( 99  99  99)   'grey39'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5520
	( 10  10  10)   'grey4'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5521
	(102 102 102)   'grey40'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5522
	(105 105 105)   'grey41'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5523
	(107 107 107)   'grey42'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5524
	(110 110 110)   'grey43'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5525
	(112 112 112)   'grey44'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5526
	(115 115 115)   'grey45'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5527
	(117 117 117)   'grey46'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5528
	(120 120 120)   'grey47'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5529
	(122 122 122)   'grey48'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5530
	(125 125 125)   'grey49'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5531
	( 13  13  13)   'grey5'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5532
	(127 127 127)   'grey50'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5533
	(130 130 130)   'grey51'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5534
	(133 133 133)   'grey52'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5535
	(135 135 135)   'grey53'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5536
	(138 138 138)   'grey54'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5537
	(140 140 140)   'grey55'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5538
	(143 143 143)   'grey56'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5539
	(145 145 145)   'grey57'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5540
	(148 148 148)   'grey58'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5541
	(150 150 150)   'grey59'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5542
	( 15  15  15)   'grey6'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5543
	(153 153 153)   'grey60'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5544
	(156 156 156)   'grey61'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5545
	(158 158 158)   'grey62'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5546
	(161 161 161)   'grey63'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5547
	(163 163 163)   'grey64'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5548
	(166 166 166)   'grey65'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5549
	(168 168 168)   'grey66'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5550
	(171 171 171)   'grey67'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5551
	(173 173 173)   'grey68'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5552
	(176 176 176)   'grey69'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5553
	( 18  18  18)   'grey7'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5554
	(179 179 179)   'grey70'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5555
	(181 181 181)   'grey71'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5556
	(184 184 184)   'grey72'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5557
	(186 186 186)   'grey73'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5558
	(189 189 189)   'grey74'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5559
	(191 191 191)   'grey75'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5560
	(194 194 194)   'grey76'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5561
	(196 196 196)   'grey77'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5562
	(199 199 199)   'grey78'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5563
	(201 201 201)   'grey79'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5564
	( 20  20  20)   'grey8'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5565
	(204 204 204)   'grey80'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5566
	(207 207 207)   'grey81'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5567
	(209 209 209)   'grey82'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5568
	(212 212 212)   'grey83'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5569
	(214 214 214)   'grey84'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5570
	(217 217 217)   'grey85'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5571
	(219 219 219)   'grey86'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5572
	(222 222 222)   'grey87'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5573
	(224 224 224)   'grey88'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5574
	(227 227 227)   'grey89'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5575
	( 23  23  23)   'grey9'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5576
	(229 229 229)   'grey90'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5577
	(232 232 232)   'grey91'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5578
	(235 235 235)   'grey92'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5579
	(237 237 237)   'grey93'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5580
	(240 240 240)   'grey94'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5581
	(242 242 242)   'grey95'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5582
	(245 245 245)   'grey96'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5583
	(247 247 247)   'grey97'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5584
	(250 250 250)   'grey98'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5585
	(252 252 252)   'grey99'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5586
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5587
	(192 192 192)   'gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5588
	(  0   0   0)   'gray0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5589
	(  3   3   3)   'gray1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5590
	( 26  26  26)   'gray10'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5591
	(255 255 255)   'gray100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5592
	( 28  28  28)   'gray11'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5593
	( 31  31  31)   'gray12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5594
	( 33  33  33)   'gray13'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5595
	( 36  36  36)   'gray14'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5596
	( 38  38  38)   'gray15'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5597
	( 41  41  41)   'gray16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5598
	( 43  43  43)   'gray17'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5599
	( 46  46  46)   'gray18'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5600
	( 48  48  48)   'gray19'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5601
	(  5   5   5)   'gray2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5602
	( 51  51  51)   'gray20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5603
	( 54  54  54)   'gray21'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5604
	( 56  56  56)   'gray22'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5605
	( 59  59  59)   'gray23'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5606
	( 61  61  61)   'gray24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5607
	( 64  64  64)   'gray25'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5608
	( 66  66  66)   'gray26'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5609
	( 69  69  69)   'gray27'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5610
	( 71  71  71)   'gray28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5611
	( 74  74  74)   'gray29'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5612
	(  8   8   8)   'gray3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5613
	( 77  77  77)   'gray30'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5614
	( 79  79  79)   'gray31'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5615
	( 82  82  82)   'gray32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5616
	( 84  84  84)   'gray33'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5617
	( 87  87  87)   'gray34'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5618
	( 89  89  89)   'gray35'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5619
	( 92  92  92)   'gray36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5620
	( 94  94  94)   'gray37'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5621
	( 97  97  97)   'gray38'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5622
	( 99  99  99)   'gray39'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5623
	( 10  10  10)   'gray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5624
	(102 102 102)   'gray40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5625
	(105 105 105)   'gray41'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5626
	(107 107 107)   'gray42'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5627
	(110 110 110)   'gray43'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5628
	(112 112 112)   'gray44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5629
	(115 115 115)   'gray45'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5630
	(117 117 117)   'gray46'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5631
	(120 120 120)   'gray47'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5632
	(122 122 122)   'gray48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5633
	(125 125 125)   'gray49'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5634
	( 13  13  13)   'gray5'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5635
	(127 127 127)   'gray50'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5636
	(130 130 130)   'gray51'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5637
	(133 133 133)   'gray52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5638
	(135 135 135)   'gray53'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5639
	(138 138 138)   'gray54'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5640
	(140 140 140)   'gray55'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5641
	(143 143 143)   'gray56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5642
	(145 145 145)   'gray57'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5643
	(148 148 148)   'gray58'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5644
	(150 150 150)   'gray59'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5645
	( 15  15  15)   'gray6'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5646
	(153 153 153)   'gray60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5647
	(156 156 156)   'gray61'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5648
	(158 158 158)   'gray62'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5649
	(161 161 161)   'gray63'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5650
	(163 163 163)   'gray64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5651
	(166 166 166)   'gray65'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5652
	(168 168 168)   'gray66'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5653
	(171 171 171)   'gray67'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5654
	(173 173 173)   'gray68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5655
	(176 176 176)   'gray69'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5656
	( 18  18  18)   'gray7'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5657
	(179 179 179)   'gray70'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5658
	(181 181 181)   'gray71'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5659
	(184 184 184)   'gray72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5660
	(186 186 186)   'gray73'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5661
	(189 189 189)   'gray74'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5662
	(191 191 191)   'gray75'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5663
	(194 194 194)   'gray76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5664
	(196 196 196)   'gray77'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5665
	(199 199 199)   'gray78'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5666
	(201 201 201)   'gray79'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5667
	( 20  20  20)   'gray8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5668
	(204 204 204)   'gray80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5669
	(207 207 207)   'gray81'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5670
	(209 209 209)   'gray82'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5671
	(212 212 212)   'gray83'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5672
	(214 214 214)   'gray84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5673
	(217 217 217)   'gray85'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5674
	(219 219 219)   'gray86'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5675
	(222 222 222)   'gray87'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5676
	(224 224 224)   'gray88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5677
	(227 227 227)   'gray89'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5678
	( 23  23  23)   'gray9'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5679
	(229 229 229)   'gray90'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5680
	(232 232 232)   'gray91'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5681
	(235 235 235)   'gray92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5682
	(237 237 237)   'gray93'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5683
	(240 240 240)   'gray94'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5684
	(242 242 242)   'gray95'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5685
	(245 245 245)   'gray96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5686
	(247 247 247)   'gray97'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5687
	(250 250 250)   'gray98'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5688
	(252 252 252)   'gray99'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5689
	(  0 255   0)   'green'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5690
	(173 255  47)   'greenyellow'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5691
	(  0 255   0)   'green1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5692
	(  0 238   0)   'green2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5693
	(  0 205   0)   'green3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5694
	(  0 139   0)   'green4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5695
	(240 255 240)   'honeydew'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5696
	(240 255 240)   'honeydew1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5697
	(224 238 224)   'honeydew2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5698
	(193 205 193)   'honeydew3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5699
	(131 139 131)   'honeydew4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5700
	(255 105 180)   'hotpink'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5701
	(255 110 180)   'HotPink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5702
	(238 106 167)   'HotPink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5703
	(205  96 144)   'HotPink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5704
	(139  58  98)   'HotPink4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5705
	(205  92  92)   'indianred'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5706
	(255 106 106)   'IndianRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5707
	(238  99  99)   'IndianRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5708
	(205  85  85)   'IndianRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5709
	(139  58  58)   'IndianRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5710
	(255 255 240)   'ivory'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5711
	(255 255 240)   'ivory1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5712
	(238 238 224)   'ivory2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5713
	(205 205 193)   'ivory3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5714
	(139 139 131)   'ivory4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5715
	(240 230 140)   'khaki'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5716
	(255 246 143)   'khaki1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5717
	(238 230 133)   'khaki2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5718
	(205 198 115)   'khaki3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5719
	(139 134  78)   'khaki4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5720
	(230 230 250)   'lavender'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5721
	(255 240 245)   'lavenderblush'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5722
	(255 240 245)   'LavenderBlush1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5723
	(238 224 229)   'LavenderBlush2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5724
	(205 193 197)   'LavenderBlush3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5725
	(139 131 134)   'LavenderBlush4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5726
	(124 252   0)   'lawngreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5727
	(255 250 205)   'lemonchiffon'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5728
	(255 250 205)   'LemonChiffon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5729
	(238 233 191)   'LemonChiffon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5730
	(205 201 165)   'LemonChiffon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5731
	(139 137 112)   'LemonChiffon4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5732
	(173 216 230)   'lightblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5733
	(240 128 128)   'lightcoral'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5734
	(224 255 255)   'lightcyan'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5735
	(238 221 130)   'lightgoldenrod'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5736
	(250 250 210)   'lightgoldenrodyellow'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5737
	(211 211 211)   'lightgray'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5738
	(144 238 144)   'lightgreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5739
	(211 211 211)   'lightgrey'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5740
	(255 182 193)   'lightpink'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5741
	(255 160 122)   'lightsalmon'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5742
	( 32 178 170)   'lightseagreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5743
	(135 206 250)   'lightskyblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5744
	(132 112 255)   'lightslateblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5745
	(119 136 153)   'lightslategray'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5746
	(119 136 153)   'lightslategrey'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5747
	(176 196 222)   'lightsteelblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5748
	(255 255 224)   'lightyellow'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5749
	(191 239 255)   'LightBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5750
	(178 223 238)   'LightBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5751
	(154 192 205)   'LightBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5752
	(104 131 139)   'LightBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5753
	(224 255 255)   'LightCyan1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5754
	(209 238 238)   'LightCyan2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5755
	(180 205 205)   'LightCyan3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5756
	(122 139 139)   'LightCyan4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5757
	(255 236 139)   'LightGoldenrod1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5758
	(238 220 130)   'LightGoldenrod2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5759
	(205 190 112)   'LightGoldenrod3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5760
	(139 129  76)   'LightGoldenrod4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5761
	(255 174 185)   'LightPink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5762
	(238 162 173)   'LightPink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5763
	(205 140 149)   'LightPink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5764
	(139  95 101)   'LightPink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5765
	(255 160 122)   'LightSalmon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5766
	(238 149 114)   'LightSalmon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5767
	(205 129  98)   'LightSalmon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5768
	(139  87  66)   'LightSalmon4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5769
	(176 226 255)   'LightSkyBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5770
	(164 211 238)   'LightSkyBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5771
	(141 182 205)   'LightSkyBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5772
	( 96 123 139)   'LightSkyBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5773
	(202 225 255)   'LightSteelBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5774
	(188 210 238)   'LightSteelBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5775
	(162 181 205)   'LightSteelBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5776
	(110 123 139)   'LightSteelBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5777
	(255 255 224)   'LightYellow1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5778
	(238 238 209)   'LightYellow2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5779
	(205 205 180)   'LightYellow3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5780
	(139 139 122)   'LightYellow4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5781
	( 50 205  50)   'limegreen'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5782
	(250 240 230)   'linen'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5783
	(255   0 255)   'magenta'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5784
	(255   0 255)   'magenta1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5785
	(238   0 238)   'magenta2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5786
	(205   0 205)   'magenta3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5787
	(139   0 139)   'magenta4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5788
	(176  48  96)   'maroon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5789
	(255  52 179)   'maroon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5790
	(238  48 167)   'maroon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5791
	(205  41 144)   'maroon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5792
	(139  28  98)   'maroon4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5793
	(102 205 170)   'mediumaquamarine'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5794
	(  0   0 205)   'mediumblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5795
	(186  85 211)   'mediumorchid'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5796
	(147 112 219)   'mediumpurple'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5797
	( 60 179 113)   'mediumseagreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5798
	(123 104 238)   'mediumslateblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5799
	(  0 250 154)   'mediumspringgreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5800
	( 72 209 204)   'mediumturquoise'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5801
	(199  21 133)   'mediumvioletred'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5802
	(224 102 255)   'MediumOrchid1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5803
	(209  95 238)   'MediumOrchid2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5804
	(180  82 205)   'MediumOrchid3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5805
	(122  55 139)   'MediumOrchid4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5806
	(171 130 255)   'MediumPurple1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5807
	(159 121 238)   'MediumPurple2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5808
	(137 104 205)   'MediumPurple3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5809
	( 93  71 139)   'MediumPurple4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5810
	( 25  25 112)   'midnightblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5811
	(245 255 250)   'mintcream'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5812
	(255 228 225)   'mistyrose'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5813
	(255 228 225)   'MistyRose1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5814
	(238 213 210)   'MistyRose2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5815
	(205 183 181)   'MistyRose3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5816
	(139 125 123)   'MistyRose4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5817
	(255 228 181)   'moccasin'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5818
	(255 222 173)   'navajowhite'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5819
	(255 222 173)   'NavajoWhite1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5820
	(238 207 161)   'NavajoWhite2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5821
	(205 179 139)   'NavajoWhite3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5822
	(139 121  94)   'NavajoWhite4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5823
	(  0   0 128)   'navy'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5824
	(  0   0 128)   'navyblue'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5825
	(253 245 230)   'oldlace'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5826
	(107 142  35)   'olivedrab'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5827
	(192 255  62)   'OliveDrab1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5828
	(179 238  58)   'OliveDrab2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5829
	(154 205  50)   'OliveDrab3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5830
	(105 139  34)   'OliveDrab4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5831
	(255 165   0)   'orange'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5832
	(255 165   0)   'orange1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5833
	(238 154   0)   'orange2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5834
	(205 133   0)   'orange3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5835
	(139  90   0)   'orange4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5836
	(255  69   0)   'orangered'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5837
	(255  69   0)   'OrangeRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5838
	(238  64   0)   'OrangeRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5839
	(205  55   0)   'OrangeRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5840
	(139  37   0)   'OrangeRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5841
	(218 112 214)   'orchid'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5842
	(255 131 250)   'orchid1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5843
	(238 122 233)   'orchid2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5844
	(205 105 201)   'orchid3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5845
	(139  71 137)   'orchid4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5846
	(238 232 170)   'palegoldenrod'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5847
	(152 251 152)   'palegreen'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5848
	(175 238 238)   'paleturquoise'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5849
	(219 112 147)   'palevioletred'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5850
	(154 255 154)   'PaleGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5851
	(144 238 144)   'PaleGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5852
	(124 205 124)   'PaleGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5853
	( 84 139  84)   'PaleGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5854
	(187 255 255)   'PaleTurquoise1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5855
	(174 238 238)   'PaleTurquoise2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5856
	(150 205 205)   'PaleTurquoise3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5857
	(102 139 139)   'PaleTurquoise4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5858
	(255 130 171)   'PaleVioletRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5859
	(238 121 159)   'PaleVioletRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5860
	(205 104 137)   'PaleVioletRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5861
	(139  71  93)   'PaleVioletRed4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5862
	(255 239 213)   'papayawhip'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5863
	(255 218 185)   'peachpuff'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5864
	(255 218 185)   'PeachPuff1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5865
	(238 203 173)   'PeachPuff2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5866
	(205 175 149)   'PeachPuff3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5867
	(139 119 101)   'PeachPuff4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5868
	(205 133  63)   'peru'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5869
	(255 192 203)   'pink'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5870
	(255 181 197)   'pink1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5871
	(238 169 184)   'pink2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5872
	(205 145 158)   'pink3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5873
	(139  99 108)   'pink4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5874
	(221 160 221)   'plum'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5875
	(255 187 255)   'plum1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5876
	(238 174 238)   'plum2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5877
	(205 150 205)   'plum3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5878
	(139 102 139)   'plum4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5879
	(176 224 230)   'powderblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5880
	(160  32 240)   'purple'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5881
	(155  48 255)   'purple1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5882
	(145  44 238)   'purple2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5883
	(125  38 205)   'purple3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5884
	( 85  26 139)   'purple4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5885
	(255   0   0)   'red'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5886
	(255   0   0)   'red1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5887
	(238   0   0)   'red2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5888
	(205   0   0)   'red3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5889
	(139   0   0)   'red4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5890
	(188 143 143)   'rosybrown'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5891
	(255 193 193)   'RosyBrown1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5892
	(238 180 180)   'RosyBrown2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5893
	(205 155 155)   'RosyBrown3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5894
	(139 105 105)   'RosyBrown4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5895
	( 65 105 225)   'royalblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5896
	( 72 118 255)   'RoyalBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5897
	( 67 110 238)   'RoyalBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5898
	( 58  95 205)   'RoyalBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5899
	( 39  64 139)   'RoyalBlue4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5900
	(139  69  19)   'saddlebrown'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5901
	(250 128 114)   'salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5902
	(255 140 105)   'salmon1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5903
	(238 130  98)   'salmon2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5904
	(205 112  84)   'salmon3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5905
	(139  76  57)   'salmon4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5906
	(244 164  96)   'sandybrown'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5907
	( 255 206 137)  'scoActiveBackground'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5908
	( 43  45  49)   'scoActiveForeground'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5909
	( 254 222 255)  'scoActiveTopShadow'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5910
	( 172 186 204)  'scoAltBackground'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5911
	( 203 203 192)  'scoBackground'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5912
	( 11   0 113)   'scoForeground'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5913
	( 141 178 215)  'scoHighlight'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5914
	( 255 240 248)  'scoTopShadow'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5915
	( 46 139  87)   'seagreen'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5916
	( 84 255 159)   'SeaGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5917
	( 78 238 148)   'SeaGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5918
	( 67 205 128)   'SeaGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5919
	( 46 139  87)   'SeaGreen4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5920
	(255 245 238)   'seashell'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5921
	(255 245 238)   'seashell1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5922
	(238 229 222)   'seashell2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5923
	(205 197 191)   'seashell3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5924
	(139 134 130)   'seashell4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5925
	(142 56 142)    'sgi beet'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5926
	(197 193 170)   'sgi bright gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5927
	(197 193 170)   'sgi bright grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5928
	(113 198 113)   'sgi chartreuse'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5929
	( 85  85  85)   'sgi dark gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5930
	( 85  85  85)   'sgi dark grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5931
	(  0   0   0)   'sgi gray 0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5932
	(255 255 255)   'sgi gray 100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5933
	( 30  30  30)   'sgi gray 12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5934
	( 40  40  40)   'sgi gray 16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5935
	( 51  51  51)   'sgi gray 20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5936
	( 61  61  61)   'sgi gray 24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5937
	( 71  71  71)   'sgi gray 28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5938
	( 81  81  81)   'sgi gray 32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5939
	( 91  91  91)   'sgi gray 36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5940
	( 10  10  10)   'sgi gray 4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5941
	(102 102 102)   'sgi gray 40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5942
	(112 112 112)   'sgi gray 44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5943
	(122 122 122)   'sgi gray 48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5944
	(132 132 132)   'sgi gray 52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5945
	(142 142 142)   'sgi gray 56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5946
	(153 153 153)   'sgi gray 60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5947
	(163 163 163)   'sgi gray 64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5948
	(173 173 173)   'sgi gray 68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5949
	(183 183 183)   'sgi gray 72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5950
	(193 193 193)   'sgi gray 76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5951
	( 20  20  20)   'sgi gray 8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5952
	(204 204 204)   'sgi gray 80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5953
	(214 214 214)   'sgi gray 84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5954
	(224 224 224)   'sgi gray 88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5955
	(234 234 234)   'sgi gray 92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5956
	(244 244 244)   'sgi gray 96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5957
	(  0   0   0)   'sgi grey 0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5958
	(255 255 255)   'sgi grey 100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5959
	( 30  30  30)   'sgi grey 12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5960
	( 40  40  40)   'sgi grey 16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5961
	( 51  51  51)   'sgi grey 20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5962
	( 61  61  61)   'sgi grey 24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5963
	( 71  71  71)   'sgi grey 28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5964
	( 81  81  81)   'sgi grey 32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5965
	( 91  91  91)   'sgi grey 36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5966
	( 10  10  10)   'sgi grey 4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5967
	(102 102 102)   'sgi grey 40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5968
	(112 112 112)   'sgi grey 44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5969
	(122 122 122)   'sgi grey 48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5970
	(132 132 132)   'sgi grey 52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5971
	(142 142 142)   'sgi grey 56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5972
	(153 153 153)   'sgi grey 60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5973
	(163 163 163)   'sgi grey 64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5974
	(173 173 173)   'sgi grey 68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5975
	(183 183 183)   'sgi grey 72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5976
	(193 193 193)   'sgi grey 76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5977
	( 20  20  20)   'sgi grey 8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5978
	(204 204 204)   'sgi grey 80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5979
	(214 214 214)   'sgi grey 84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5980
	(224 224 224)   'sgi grey 88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5981
	(234 234 234)   'sgi grey 92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5982
	(244 244 244)   'sgi grey 96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5983
	(125 158 192)   'sgi light blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5984
	(170 170 170)   'sgi light gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5985
	(170 170 170)   'sgi light grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5986
	(132 132 132)   'sgi medium gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5987
	(132 132 132)   'sgi medium grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5988
	(142 142  56)   'sgi olive drab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5989
	(198 113 113)   'sgi salmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5990
	(113 113 198)   'sgi slate blue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5991
	( 56 142 142)   'sgi teal'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5992
	( 40  40  40)   'sgi very dark gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5993
	( 40  40  40)   'sgi very dark grey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5994
	(214 214 214)   'sgi very light gray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5995
	(214 214 214)   'sgi very light grey'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  5996
	(142 56 142)    'SGIBeet'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5997
	(197 193 170)   'SGIBrightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5998
	(197 193 170)   'SGIBrightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5999
	(113 198 113)   'SGIChartreuse'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6000
	( 85  85  85)   'SGIDarkGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6001
	( 85  85  85)   'SGIDarkGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6002
	(  0   0   0)   'SGIGray0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6003
	(255 255 255)   'SGIGray100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6004
	( 30  30  30)   'SGIGray12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6005
	( 40  40  40)   'SGIGray16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6006
	( 51  51  51)   'SGIGray20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6007
	( 61  61  61)   'SGIGray24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6008
	( 71  71  71)   'SGIGray28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6009
	( 81  81  81)   'SGIGray32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6010
	( 91  91  91)   'SGIGray36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6011
	( 10  10  10)   'SGIGray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6012
	(102 102 102)   'SGIGray40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6013
	(112 112 112)   'SGIGray44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6014
	(122 122 122)   'SGIGray48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6015
	(132 132 132)   'SGIGray52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6016
	(142 142 142)   'SGIGray56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6017
	(153 153 153)   'SGIGray60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6018
	(163 163 163)   'SGIGray64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6019
	(173 173 173)   'SGIGray68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6020
	(183 183 183)   'SGIGray72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6021
	(193 193 193)   'SGIGray76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6022
	( 20  20  20)   'SGIGray8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6023
	(204 204 204)   'SGIGray80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6024
	(214 214 214)   'SGIGray84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6025
	(224 224 224)   'SGIGray88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6026
	(234 234 234)   'SGIGray92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6027
	(244 244 244)   'SGIGray96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6028
	(  0   0   0)   'SGIGrey0'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6029
	(255 255 255)   'SGIGrey100'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6030
	( 30  30  30)   'SGIGrey12'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6031
	( 40  40  40)   'SGIGrey16'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6032
	( 51  51  51)   'SGIGrey20'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6033
	( 61  61  61)   'SGIGrey24'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6034
	( 71  71  71)   'SGIGrey28'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6035
	( 81  81  81)   'SGIGrey32'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6036
	( 91  91  91)   'SGIGrey36'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6037
	( 10  10  10)   'SGIGrey4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6038
	(102 102 102)   'SGIGrey40'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6039
	(112 112 112)   'SGIGrey44'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6040
	(122 122 122)   'SGIGrey48'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6041
	(132 132 132)   'SGIGrey52'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6042
	(142 142 142)   'SGIGrey56'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6043
	(153 153 153)   'SGIGrey60'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6044
	(163 163 163)   'SGIGrey64'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6045
	(173 173 173)   'SGIGrey68'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6046
	(183 183 183)   'SGIGrey72'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6047
	(193 193 193)   'SGIGrey76'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6048
	( 20  20  20)   'SGIGrey8'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6049
	(204 204 204)   'SGIGrey80'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6050
	(214 214 214)   'SGIGrey84'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6051
	(224 224 224)   'SGIGrey88'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6052
	(234 234 234)   'SGIGrey92'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6053
	(244 244 244)   'SGIGrey96'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6054
	(125 158 192)   'SGILightBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6055
	(170 170 170)   'SGILightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6056
	(170 170 170)   'SGILightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6057
	(132 132 132)   'SGIMediumGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6058
	(132 132 132)   'SGIMediumGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6059
	(142 142  56)   'SGIOliveDrab'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6060
	(198 113 113)   'SGISalmon'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6061
	(113 113 198)   'SGISlateBlue'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6062
	( 56 142 142)   'SGITeal'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6063
	( 40  40  40)   'SGIVeryDarkGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6064
	( 40  40  40)   'SGIVeryDarkGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6065
	(214 214 214)   'SGIVeryLightGray'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6066
	(214 214 214)   'SGIVeryLightGrey'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6067
	(160  82  45)   'sienna'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6068
	(255 130  71)   'sienna1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6069
	(238 121  66)   'sienna2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6070
	(205 104  57)   'sienna3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6071
	(139  71  38)   'sienna4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  6072
	(135 206 235)   'skyblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6073
	(135 206 255)   'SkyBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6074
	(126 192 238)   'SkyBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6075
	(108 166 205)   'SkyBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6076
	( 74 112 139)   'SkyBlue4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  6077
	(112 128 144)   'slategray'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  6078
	(112 128 144)   'slategrey'
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  6079
	(106  90 205)   'slateblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6080
	(131 111 255)   'SlateBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6081
	(122 103 238)   'SlateBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6082
	(105  89 205)   'SlateBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6083
	( 71  60 139)   'SlateBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6084
	(198 226 255)   'SlateGray1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6085
	(185 211 238)   'SlateGray2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6086
	(159 182 205)   'SlateGray3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6087
	(108 123 139)   'SlateGray4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6088
	(255 250 250)   'snow'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6089
	(255 250 250)   'snow1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6090
	(238 233 233)   'snow2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6091
	(205 201 201)   'snow3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6092
	(139 137 137)   'snow4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  6093
	(  0 255 127)   'springgreen'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6094
	(  0 255 127)   'SpringGreen1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6095
	(  0 238 118)   'SpringGreen2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6096
	(  0 205 102)   'SpringGreen3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6097
	(  0 139  69)   'SpringGreen4'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  6098
	( 70 130 180)   'steelblue'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6099
	( 99 184 255)   'SteelBlue1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6100
	( 92 172 238)   'SteelBlue2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6101
	( 79 148 205)   'SteelBlue3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6102
	( 54 100 139)   'SteelBlue4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6103
	(210 180 140)   'tan'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6104
	(255 165  79)   'tan1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6105
	(238 154  73)   'tan2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6106
	(205 133  63)   'tan3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6107
	(139  90  43)   'tan4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6108
	(216 191 216)   'thistle'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6109
	(255 225 255)   'thistle1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6110
	(238 210 238)   'thistle2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6111
	(205 181 205)   'thistle3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6112
	(139 123 139)   'thistle4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6113
	(255  99  71)   'tomato'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6114
	(255  99  71)   'tomato1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6115
	(238  92  66)   'tomato2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6116
	(205  79  57)   'tomato3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6117
	(139  54  38)   'tomato4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6118
	( 64 224 208)   'turquoise'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6119
	(  0 245 255)   'turquoise1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6120
	(  0 229 238)   'turquoise2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6121
	(  0 197 205)   'turquoise3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6122
	(  0 134 139)   'turquoise4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6123
	(238 130 238)   'violet'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  6124
	(208  32 144)   'violetred'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6125
	(255  62 150)   'VioletRed1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6126
	(238  58 140)   'VioletRed2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6127
	(205  50 120)   'VioletRed3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6128
	(139  34  82)   'VioletRed4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6129
	(245 222 179)   'wheat'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6130
	(255 231 186)   'wheat1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6131
	(238 216 174)   'wheat2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6132
	(205 186 150)   'wheat3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6133
	(139 126 102)   'wheat4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6134
	(255 255 255)   'white'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  6135
	(245 245 245)   'whitesmoke'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6136
	(255 255   0)   'yellow'
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  6137
	(154 205  50)   'yellowgreen'
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6138
	(255 255   0)   'yellow1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6139
	(238 238   0)   'yellow2'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6140
	(205 205   0)   'yellow3'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6141
	(139 139   0)   'yellow4'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6142
    ) pairWiseDo:[ :value :name |
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6143
	StandardColorValues at:name put:value
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6144
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6145
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6146
     WinWorkstation initializeStandardColorNames
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6147
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6148
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6149
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6150
!WinWorkstation class methodsFor:'debugging'!
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6151
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6152
bitmapHandleCounts
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6153
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6154
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6155
%{  /* NOCONTEXT */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6156
#ifdef COUNT_BMP_RESOURCES
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6157
    RETURN ( __MKSMALLINT(__cnt_bitmap));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6158
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6159
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6160
#endif
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6161
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6162
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6163
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6164
cursorHandleCounts
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6165
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6166
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6167
%{  /* NOCONTEXT */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6168
#ifdef COUNT_RESOURCES
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6169
    RETURN ( __MKSMALLINT(__cnt_cur));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6170
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6171
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6172
#endif
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6173
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6174
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6175
4265
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6176
debug
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6177
%{  /* NOCONTEXT */
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6178
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6179
    RETURN (__debug__ != 0 ? true : false);
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6180
%}
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6181
!
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6182
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  6183
debug2
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  6184
    "enable more debug prints - this will vanish"
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  6185
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  6186
%{  /* NOCONTEXT */
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  6187
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  6188
    __debug__ = 2;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  6189
%}
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  6190
!
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  6191
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6192
debug:aBoolean
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6193
    "enable/disable debug prints - this will vanish"
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6194
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6195
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6196
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6197
    __debug__ = (aBoolean == true) ? 1 : 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6198
%}
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6199
    "
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6200
     WinWorkstation debug:true
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6201
     WinWorkstation debug:false
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6202
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6203
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6204
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6205
debug:aBoolean message:msg
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6206
    msg = 'WM_MOUSEENTER' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6207
%{
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6208
	__debug_WM_MOUSEENTER__ = (aBoolean == true) ? 1 : 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6209
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6210
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6211
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6212
    msg = 'WM_MOUSELEAVE' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6213
%{
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6214
	__debug_WM_MOUSELEAVE__ = (aBoolean == true) ? 1 : 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6215
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6216
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6217
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6218
    msg = 'WM_MOUSEMOVE' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6219
%{
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6220
	__debug_WM_MOUSEMOVE__ = (aBoolean == true) ? 1 : 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6221
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6222
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6223
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6224
    msg = 'WM_MOUSEACTIVATE' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6225
%{
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6226
	__debug_WM_MOUSEACTIVATE__ = (aBoolean == true) ? 1 : 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6227
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6228
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6229
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6230
    msg = 'WM_BUTTONUP' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6231
%{
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6232
	__debug_WM_BUTTONUP__ = (aBoolean == true) ? 1 : 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6233
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6234
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6235
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6236
    msg = 'WM_BUTTONDOWN' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6237
%{
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6238
	__debug_WM_BUTTONDOWN__ = (aBoolean == true) ? 1 : 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6239
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6240
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6241
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6242
    msg = 'WM_KEYUP' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6243
%{
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6244
	__debug_WM_KEYUP__ = (aBoolean == true) ? 1 : 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6245
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6246
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6247
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6248
    msg = 'WM_KEYDOWN' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6249
%{
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6250
	__debug_WM_KEYDOWN__ = (aBoolean == true) ? 1 : 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6251
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6252
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6253
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6254
    msg = 'WM_PAINT' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6255
%{
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6256
	__debug_WM_PAINT__ = (aBoolean == true) ? 1 : 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6257
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6258
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6259
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6260
    msg = 'WM_MOVING' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6261
%{
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6262
	__debug_WM_MOVING__ = (aBoolean == true) ? 1 : 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6263
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6264
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6265
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6266
    msg = 'WM_ERASEBKGND' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6267
%{
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6268
	__debug_WM_ERASEBKGND__ = (aBoolean == true) ? 1 : 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6269
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6270
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6271
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6272
    msg = 'WM_SETTEXT' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6273
%{
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6274
	__debug_WM_SETTEXT__ = (aBoolean == true) ? 1 : 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6275
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6276
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6277
    ].
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
  6278
    msg = 'WM_COPYDATA' ifTrue:[
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
  6279
%{
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
  6280
	__debug_WM_COPYDATA__ = (aBoolean == true) ? 1 : 0;
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
  6281
	RETURN (self);
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
  6282
%}
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
  6283
    ].
5230
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6284
    msg = 'WM_DROPFILES' ifTrue:[
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6285
%{
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6286
	__debug_WM_DROPFILES__ = (aBoolean == true) ? 1 : 0;
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6287
	RETURN (self);
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6288
%}
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6289
    ].
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6290
    msg = 'WM_SHOWWINDOW' ifTrue:[
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6291
%{
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6292
	__debug_WM_SHOWWINDOW__ = (aBoolean == true) ? 1 : 0;
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6293
	RETURN (self);
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6294
%}
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6295
    ].
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  6296
    msg = 'WM_CHAR' ifTrue:[
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  6297
%{
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  6298
	__debug_WM_CHAR__ = (aBoolean == true) ? 1 : 0;
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  6299
	RETURN (self);
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  6300
%}
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  6301
    ].
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6302
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6303
    "
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6304
     WinWorkstation debug:true
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6305
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6306
     WinWorkstation debug:false message:'WM_KEYUP'
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6307
     WinWorkstation debug:false message:'WM_KEYDOWN'
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6308
     WinWorkstation debug:false message:'WM_PAINT'
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6309
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6310
     WinWorkstation debug:true message:'WM_KEYUP'
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6311
     WinWorkstation debug:true message:'WM_KEYDOWN'
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  6312
     WinWorkstation debug:true message:'WM_CHAR'
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6313
    "
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  6314
!
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  6315
4248
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6316
debugNative
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6317
%{  /* NOCONTEXT */
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6318
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6319
    RETURN (__debugNative__ == 0 ? false : true);
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6320
%}
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6321
    "
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6322
     WinWorkstation debugNative
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6323
    "
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6324
!
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6325
4236
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6326
debugNative:aBoolean
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6327
%{  /* NOCONTEXT */
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6328
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6329
    __debugNative__ = (aBoolean == true) ? 1 : 0;
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6330
%}
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6331
    "
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6332
     WinWorkstation debugNative:true
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6333
     WinWorkstation debugNative:false
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6334
    "
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6335
!
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6336
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6337
fontHandleCounts
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6338
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6339
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6340
%{  /* NOCONTEXT */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6341
#ifdef COUNT_RESOURCES
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6342
    RETURN ( __MKSMALLINT(__cnt_font));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6343
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6344
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6345
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6346
%}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6347
!
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6348
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6349
gcDataHandleCounts
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6350
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6351
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6352
%{  /* NOCONTEXT */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6353
#ifdef COUNT_RESOURCES
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6354
    RETURN ( __MKSMALLINT(__cnt_gcData));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6355
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6356
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6357
#endif
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6358
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6359
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6360
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6361
printHandleCounts
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6362
   "show prim values"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6363
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6364
   ('WINWORKSTATION: pW=', self windowHandleCounts printString,
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6365
    'pB=',self bitmapHandleCounts printString,
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6366
    'pGc=',self gcDataHandleCounts printString,
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6367
    'pbmpdc=',self bmpDcHandleCounts printString) errorPrintNL
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6368
!
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6369
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6370
windowHandleCounts
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6371
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6372
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6373
%{  /* NOCONTEXT */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6374
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6375
    RETURN ( __MKSMALLINT(__cnt_createWindows));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6376
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6377
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6378
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6379
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6380
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6381
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6382
!WinWorkstation class methodsFor:'queries'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6383
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6384
platformName
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6385
    "ST-80 compatibility.
2777
60ba83db1fab comment
Claus Gittinger <cg@exept.de>
parents: 2766
diff changeset
  6386
     Return a string describing the display systems platform.
60ba83db1fab comment
Claus Gittinger <cg@exept.de>
parents: 2766
diff changeset
  6387
     WinWorkstation always returns 'WIN32'."
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6388
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6389
    ^ 'WIN32'
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6390
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6391
    "Modified: 26.5.1996 / 15:32:46 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6392
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6393
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6394
!WinWorkstation methodsFor:'accessing & queries'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6395
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6396
activateOnClick:aBoolean
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6397
    "set/clear the activateOnClick behavior.
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6398
     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
  6399
     the window.
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6400
     Windows users typically enable this;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6401
     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
  6402
     it disabled.
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6403
     Returns the previous setting.
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6404
     The default is true."
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6405
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6406
%{  /* NOCONTEXT */
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6407
    OBJ rslt = __activateOnClick ? true : false;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6408
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6409
    if (aBoolean == true) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6410
       __activateOnClick = 1;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6411
    } else {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6412
       if (aBoolean == false) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6413
	   __activateOnClick = 0;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6414
       }
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6415
    }
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6416
    RETURN (rslt);
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6417
%}
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6418
    "
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  6419
     Display activateOnClick:true
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  6420
     Display activateOnClick:false
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  6421
    "
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  6422
!
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  6423
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6424
anyButtonMotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6425
    "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
  6426
     This is the devices mask."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6427
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6428
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6429
    RETURN ( __MKSMALLINT(Button1MotionMask | Button2MotionMask | Button3MotionMask));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6430
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6431
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6432
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6433
blackpixel
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6434
    "return the colornumber of black"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6435
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6436
    ^ blackpixel
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6437
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6438
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6439
button1MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6440
    "return the state-mask for button1 in motion events' state-field.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6441
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6442
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6443
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6444
    RETURN (__MKSMALLINT(Button1MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6445
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6446
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6447
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6448
     Display button1MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6449
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6450
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6451
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6452
button2MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6453
    "return the state-mask for button2 in motion events' state-field
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6454
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6455
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6456
%{  /* NOCONTEXT */
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6457
    RETURN (__MKSMALLINT(Button2MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6458
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6459
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6460
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6461
button3MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6462
    "return the state-mask for button3 in motion events' state-field
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6463
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6464
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6465
%{  /* NOCONTEXT */
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6466
    RETURN (__MKSMALLINT(Button3MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6467
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6468
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6469
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6470
buttonMotionMask:aButton
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6471
    "return the state-mask for button1 in motion events state-field.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6472
     This is the devices mask."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6473
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6474
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6475
    if (aButton == __MKSMALLINT(1)) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6476
	RETURN (__MKSMALLINT(Button1MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6477
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6478
    if (aButton == __MKSMALLINT(2)) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6479
	RETURN (__MKSMALLINT(Button2MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6480
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6481
    if (aButton == __MKSMALLINT(3)) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6482
	RETURN (__MKSMALLINT(Button3MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6483
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6484
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6485
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6486
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6487
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6488
controlMask
3261
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6489
    "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
  6490
     Obsolete"
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6491
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6492
%{  /* NOCONTEXT */
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6493
    RETURN (__MKSMALLINT(ControlMask));
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6494
%}
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6495
!
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6496
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6497
ctrlModifierMask
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6498
    "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
  6499
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6500
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6501
    RETURN (__MKSMALLINT(ControlMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6502
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6503
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6504
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6505
defaultEventMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6506
    "return a mask to enable some events by default."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6507
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6508
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6509
    RETURN (__MKSMALLINT( ExposureMask | StructureNotifyMask |
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6510
			 KeyPressMask | KeyReleaseMask |
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6511
			 EnterWindowMask | LeaveWindowMask |
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6512
			 ButtonPressMask | ButtonMotionMask | ButtonReleaseMask ));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6513
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6514
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6515
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6516
displayFileDescriptor
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6517
    "return the displays fileNumber for select, if any"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6518
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6519
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6520
   /* RETURN (nil);*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6521
   RETURN ( __MKEXTERNALADDRESS(hInputEvent));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6522
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6523
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6524
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6525
displayName
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6526
    "return the display-connections display name.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6527
     For Windows, a dummy name is returned"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6528
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6529
    ^ 'local'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6530
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6531
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6532
focusFollowsMouse:aBoolean
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6533
    "set/clear the focusFollowsMouse behavior.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6534
     If on, the view under the mouse gets the keyboard input
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6535
     (however, within a windowGroup, ST/X can still forward the event
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6536
      the groups focusView...).
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6537
     Windows users typically disable this;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6538
     users which are used to the X-Window system typically prefer
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6539
     it enabled.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6540
     Returns the previous setting.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6541
     The default is false."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6542
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6543
%{  /* NOCONTEXT */
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6544
    OBJ rslt = __focusFollowsMouse ? true : false;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6545
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6546
    if (aBoolean == true) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6547
       __focusFollowsMouse = 1;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6548
    } else {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6549
       if (aBoolean == false) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6550
	   __focusFollowsMouse = 0;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6551
       }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6552
    }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6553
    RETURN (rslt);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6554
%}
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6555
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6556
     WinWorkstation focusFollowsMouse:true
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6557
     WinWorkstation focusFollowsMouse:false
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6558
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6559
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6560
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6561
getSystemColor:aKey
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6562
    "retrieve a windows system color.
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6563
     The styleSheet/View classes may use this to setup default colors"
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6564
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6565
    |rgb|
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6566
4816
114cf20ad4ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4811
diff changeset
  6567
%{
4809
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6568
    int p;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6569
    int __rgb, r, g, b;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6570
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6571
    if (aKey == @symbol(COLOR_WINDOW)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6572
      p = COLOR_WINDOW;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6573
    } else if (aKey == @symbol(COLOR_WINDOWTEXT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6574
      p = COLOR_WINDOWTEXT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6575
    } else if (aKey == @symbol(COLOR_MENU)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6576
      p = COLOR_MENU;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6577
    } else if (aKey == @symbol(COLOR_MENUTEXT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6578
      p = COLOR_MENUTEXT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6579
    } else if (aKey == @symbol(COLOR_BTNFACE)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6580
      p = COLOR_BTNFACE;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6581
    } else if (aKey == @symbol(COLOR_BTNSHADOW)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6582
      p = COLOR_BTNSHADOW;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6583
    } else if (aKey == @symbol(COLOR_BTNTEXT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6584
      p = COLOR_BTNTEXT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6585
    } else if (aKey == @symbol(COLOR_GRAYTEXT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6586
      p = COLOR_GRAYTEXT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6587
    } else if (aKey == @symbol(COLOR_HIGHLIGHT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6588
      p = COLOR_HIGHLIGHT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6589
    } else if (aKey == @symbol(COLOR_HIGHLIGHTTEXT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6590
      p = COLOR_HIGHLIGHTTEXT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6591
    } else if (aKey == @symbol(COLOR_MENU)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6592
      p = COLOR_MENU;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6593
    } else if (aKey == @symbol(COLOR_MENUTEXT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6594
      p = COLOR_MENUTEXT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6595
    } else if (aKey == @symbol(COLOR_SCROLLBAR)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6596
      p = COLOR_SCROLLBAR;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6597
#ifdef COLOR_SHADOW
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6598
    } else if (aKey == @symbol(COLOR_SHADOW)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6599
      p = COLOR_SHADOW;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6600
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6601
#ifdef COLOR_BACKGROUND
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6602
    } else if (aKey == @symbol(COLOR_BACKGROUND)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6603
      p = COLOR_BACKGROUND;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6604
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6605
#ifdef COLOR_ACTIVECAPTION
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6606
    } else if (aKey == @symbol(COLOR_ACTIVECAPTION)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6607
      p = COLOR_ACTIVECAPTION;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6608
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6609
#ifdef COLOR_INACTIVECAPTION
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6610
    } else if (aKey == @symbol(COLOR_INACTIVECAPTION)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6611
      p = COLOR_INACTIVECAPTION;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6612
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6613
#ifdef COLOR_WINDOWFRAME
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6614
    } else if (aKey == @symbol(COLOR_WINDOWFRAME)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6615
      p = COLOR_WINDOWFRAME;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6616
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6617
#ifdef COLOR_CAPTIONTEXT
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6618
    } else if (aKey == @symbol(COLOR_CAPTIONTEXT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6619
      p = COLOR_CAPTIONTEXT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6620
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6621
#ifdef COLOR_ACTIVEBORDER
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6622
    } else if (aKey == @symbol(COLOR_ACTIVEBORDER)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6623
      p = COLOR_ACTIVEBORDER;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6624
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6625
#ifdef COLOR_INACTIVEBORDER
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6626
    } else if (aKey == @symbol(COLOR_INACTIVEBORDER)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6627
      p = COLOR_INACTIVEBORDER;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6628
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6629
#ifdef COLOR_APPWORKSPACE
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6630
    } else if (aKey == @symbol(COLOR_APPWORKSPACE)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6631
      p = COLOR_APPWORKSPACE;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6632
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6633
#ifdef COLOR_INACTIVECAPTIONTEXT
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6634
    } else if (aKey == @symbol(COLOR_INACTIVECAPTIONTEXT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6635
      p = COLOR_INACTIVECAPTIONTEXT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6636
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6637
#ifdef COLOR_BTNHIGHLIGHT
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6638
    } else if (aKey == @symbol(COLOR_BTNHIGHLIGHT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6639
      p = COLOR_BTNHIGHLIGHT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6640
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6641
#ifdef COLOR_3DDKSHADOW
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6642
    } else if (aKey == @symbol(COLOR_3DDKSHADOW)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6643
      p = COLOR_3DDKSHADOW;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6644
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6645
#ifdef COLOR_3DLIGHT
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6646
    } else if (aKey == @symbol(COLOR_3DLIGHT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6647
      p = COLOR_3DLIGHT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6648
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6649
#ifdef COLOR_INFOTEXT
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6650
    } else if (aKey == @symbol(COLOR_INFOTEXT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6651
      p = COLOR_INFOTEXT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6652
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6653
#ifdef COLOR_INFOBK
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6654
    } else if (aKey == @symbol(COLOR_INFOBK)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6655
      p = COLOR_INFOBK;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6656
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6657
#ifdef COLOR_HOTLIGHT
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6658
    } else if (aKey == @symbol(COLOR_HOTLIGHT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6659
      p = COLOR_HOTLIGHT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6660
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6661
#ifdef COLOR_GRADIENTACTIVECAPTION
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6662
    } else if (aKey == @symbol(COLOR_GRADIENTACTIVECAPTION)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6663
      p = COLOR_GRADIENTACTIVECAPTION;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6664
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6665
#ifdef COLOR_GRADIENTINACTIVECAPTION
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6666
    } else if (aKey == @symbol(COLOR_GRADIENTINACTIVECAPTION)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6667
      p = COLOR_GRADIENTINACTIVECAPTION;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6668
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6669
#ifdef COLOR_DESKTOP
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6670
    } else if (aKey == @symbol(COLOR_DESKTOP)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6671
      p = COLOR_DESKTOP;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6672
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6673
#ifdef COLOR_3DFACE
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6674
    } else if (aKey == @symbol(COLOR_3DFACE)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6675
      p = COLOR_3DFACE;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6676
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6677
#ifdef COLOR_3DSHADOW
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6678
    } else if (aKey == @symbol(COLOR_3DSHADOW)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6679
      p = COLOR_3DSHADOW;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6680
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6681
#ifdef COLOR_3DHIGHLIGHT
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6682
    } else if (aKey == @symbol(COLOR_3DHIGHLIGHT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6683
      p = COLOR_3DHIGHLIGHT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6684
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6685
#ifdef COLOR_3DHILIGHT
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6686
    } else if (aKey == @symbol(COLOR_3DHILIGHT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6687
      p = COLOR_3DHILIGHT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6688
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6689
#ifdef COLOR_BTNHILIGHT
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6690
    } else if (aKey == @symbol(COLOR_BTNHILIGHT)) {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6691
      p = COLOR_BTNHILIGHT;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6692
#endif
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6693
    } else {
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6694
      goto getOutOfHere;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6695
    }
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6696
    __rgb = GetSysColor(p);
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6697
    /* win uses BGR order */
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6698
    r = __rgb & 0xFF;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6699
    g = (__rgb >> 8) & 0xFF;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6700
    b = (__rgb >> 16) & 0xFF;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6701
    __rgb = (((r << 8) | g) << 8) | b;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6702
    rgb = __MKSMALLINT(__rgb);
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6703
getOutOfHere: ;
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6704
%}.
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6705
    rgb isNil ifTrue:[ ^ nil ].
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6706
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6707
    ^ Color
4816
114cf20ad4ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4811
diff changeset
  6708
	redByte:((rgb bitShift:-16) bitAnd:16rFF)
114cf20ad4ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4811
diff changeset
  6709
	greenByte:((rgb bitShift:-8) bitAnd:16rFF)
114cf20ad4ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4811
diff changeset
  6710
	blueByte:(rgb bitAnd:16rFF)
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6711
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6712
    "
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6713
     Display getSystemColor:#COLOR_WINDOW
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6714
     Display getSystemColor:#COLOR_HIGHLIGHT
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6715
    "
4809
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6716
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6717
    "Modified: / 30-10-2007 / 15:06:02 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6718
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6719
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6720
getSystemMetrics:aNumberOrSymbol
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6721
    "get a system metrics value;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6722
     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
  6723
     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
  6724
     which must be the define-value."
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6725
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6726
%{  /* NOCONTEXT */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6727
    int info = 0;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6728
    int isBool = 0;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6729
    int arg;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6730
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6731
    if (__isSmallInteger(aNumberOrSymbol)) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6732
	arg = __intVal(aNumberOrSymbol);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6733
    } else if ((aNumberOrSymbol == @symbol(swapButton)) || (aNumberOrSymbol == @symbol(SM_SWAPBUTTON))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6734
	arg = SM_SWAPBUTTON;
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6735
	isBool = 1;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6736
    } else if ((aNumberOrSymbol == @symbol(mousePresent)) || (aNumberOrSymbol == @symbol(SM_MOUSEPRESENT))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6737
	arg = SM_MOUSEPRESENT;
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6738
	isBool = 1;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6739
    } else if ((aNumberOrSymbol == @symbol(mouseButtons)) || (aNumberOrSymbol == @symbol(SM_CMOUSEBUTTONS))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6740
	arg = SM_CMOUSEBUTTONS;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6741
    } else if ((aNumberOrSymbol == @symbol(iconWidth)) || (aNumberOrSymbol == @symbol(SM_CXICON))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6742
	arg = SM_CXICON;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6743
    } else if ((aNumberOrSymbol == @symbol(iconHeight)) || (aNumberOrSymbol == @symbol(SM_CYICON))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6744
	arg = SM_CYICON;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  6745
    } else if ((aNumberOrSymbol == @symbol(iconWidth)) || (aNumberOrSymbol == @symbol(SM_CXDOUBLECLK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6746
	arg = SM_CXDOUBLECLK;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  6747
    } else if ((aNumberOrSymbol == @symbol(iconHeight)) || (aNumberOrSymbol == @symbol(SM_CYDOUBLECLK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6748
	arg = SM_CYDOUBLECLK;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6749
    } else if ((aNumberOrSymbol == @symbol(cursorWidth)) || (aNumberOrSymbol == @symbol(SM_CXCURSOR))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6750
	arg = SM_CXCURSOR;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6751
    } else if ((aNumberOrSymbol == @symbol(cursorHeight)) || (aNumberOrSymbol == @symbol(SM_CYCURSOR))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6752
	arg = SM_CYCURSOR;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6753
    } else if ((aNumberOrSymbol == @symbol(captionHeight)) || (aNumberOrSymbol == @symbol(SM_CYCAPTION))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6754
	arg = SM_CYCAPTION;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6755
    } else if ((aNumberOrSymbol == @symbol(resizeFrameWidth)) || (aNumberOrSymbol == @symbol(SM_CXFRAME))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6756
	arg = SM_CXFRAME;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6757
    } else if ((aNumberOrSymbol == @symbol(resizeFrameHeight)) || (aNumberOrSymbol == @symbol(SM_CYFRAME))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6758
	arg = SM_CYFRAME;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6759
    } else if ((aNumberOrSymbol == @symbol(borderFrameWidth)) || (aNumberOrSymbol == @symbol(SM_CXBORDER))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6760
	arg = SM_CXBORDER;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6761
    } else if ((aNumberOrSymbol == @symbol(borderFrameHeight)) || (aNumberOrSymbol == @symbol(SM_CYBORDER))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6762
	arg = SM_CYBORDER;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6763
    } else if (aNumberOrSymbol == @symbol(SM_CXDLGFRAME)) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6764
	arg = SM_CXDLGFRAME;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6765
    } else if (aNumberOrSymbol == @symbol(SM_CYDLGFRAME)) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6766
	arg = SM_CYDLGFRAME;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6767
    } else if ((aNumberOrSymbol == @symbol(fullScreenWindowWidth)) || (aNumberOrSymbol == @symbol(SM_CXFULLSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6768
	arg = SM_CXFULLSCREEN;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6769
    } else if ((aNumberOrSymbol == @symbol(fullScreenWindowHeight)) || (aNumberOrSymbol == @symbol(SM_CYFULLSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6770
	arg = SM_CYFULLSCREEN;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6771
    } else if ((aNumberOrSymbol == @symbol(screenWidth)) || (aNumberOrSymbol == @symbol(SM_CXSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6772
	arg = SM_CXSCREEN;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6773
    } else if ((aNumberOrSymbol == @symbol(screenHeight)) || (aNumberOrSymbol == @symbol(SM_CYSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6774
	arg = SM_CYSCREEN;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6775
    } else if ((aNumberOrSymbol == @symbol(minWindowWidth)) || (aNumberOrSymbol == @symbol(SM_CXMIN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6776
	arg = SM_CXMIN;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6777
    } else if ((aNumberOrSymbol == @symbol(minWindowHeight)) || (aNumberOrSymbol == @symbol(SM_CYMIN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6778
	arg = SM_CYMIN;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6779
    } else if ((aNumberOrSymbol == @symbol(vScrollbarWidth)) || (aNumberOrSymbol == @symbol(SM_CXVSCROLL))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6780
	arg = SM_CXVSCROLL;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6781
    } else if ((aNumberOrSymbol == @symbol(hScrollbarHeight)) || (aNumberOrSymbol == @symbol(SM_CYHSCROLL))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6782
	arg = SM_CYHSCROLL;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6783
    } else if ((aNumberOrSymbol == @symbol(vThumbHeight)) || (aNumberOrSymbol == @symbol(SM_CYVTHUMB))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6784
	arg = SM_CYVTHUMB;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6785
    } else if ((aNumberOrSymbol == @symbol(hThumbWidth)) || (aNumberOrSymbol == @symbol(SM_CXHTHUMB))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6786
	arg = SM_CXHTHUMB;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6787
    } else if ((aNumberOrSymbol == @symbol(SM_CXSIZE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6788
	arg = SM_CXSIZE;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6789
    } else if ((aNumberOrSymbol == @symbol(SM_CYSIZE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6790
	arg = SM_CYSIZE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6791
    } else if ((aNumberOrSymbol == @symbol(SM_CYVSCROLL))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6792
	arg = SM_CYVSCROLL;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6793
    } else if ((aNumberOrSymbol == @symbol(SM_CXHSCROLL))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6794
	arg = SM_CXHSCROLL;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6795
    } else if ((aNumberOrSymbol == @symbol(SM_CXMINTRACK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6796
	arg = SM_CXMINTRACK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6797
    } else if ((aNumberOrSymbol == @symbol(SM_CYMINTRACK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6798
	arg = SM_CYMINTRACK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6799
    } else if ((aNumberOrSymbol == @symbol(SM_CXICONSPACING))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6800
	arg = SM_CXICONSPACING;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6801
    } else if ((aNumberOrSymbol == @symbol(SM_CYICONSPACING))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6802
	arg = SM_CYICONSPACING;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6803
    } else if ((aNumberOrSymbol == @symbol(SM_CYMENU))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6804
	arg = SM_CYMENU;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6805
    } else if ((aNumberOrSymbol == @symbol(SM_MENUDROPALIGNMENT))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6806
	arg = SM_MENUDROPALIGNMENT;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6807
    } else if ((aNumberOrSymbol == @symbol(SM_PENWINDOWS))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6808
	arg = SM_PENWINDOWS;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6809
    } else if ((aNumberOrSymbol == @symbol(SM_DBCSENABLED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6810
	arg = SM_DBCSENABLED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6811
    } else if ((aNumberOrSymbol == @symbol(SM_CXFIXEDFRAME))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6812
	arg = SM_CXFIXEDFRAME;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6813
    } else if ((aNumberOrSymbol == @symbol(SM_CYFIXEDFRAME))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6814
	arg = SM_CYFIXEDFRAME;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6815
    } else if ((aNumberOrSymbol == @symbol(SM_CXSIZEFRAME))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6816
	arg = SM_CXSIZEFRAME;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6817
    } else if ((aNumberOrSymbol == @symbol(SM_CYSIZEFRAME))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6818
	arg = SM_CYSIZEFRAME;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6819
    } else if ((aNumberOrSymbol == @symbol(SM_CYKANJIWINDOW))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6820
	arg = SM_CYKANJIWINDOW;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6821
    } else if ((aNumberOrSymbol == @symbol(SM_SECURE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6822
	arg = SM_SECURE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6823
    } else if ((aNumberOrSymbol == @symbol(SM_CXEDGE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6824
	arg = SM_CXEDGE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6825
    } else if ((aNumberOrSymbol == @symbol(SM_CYEDGE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6826
	arg = SM_CYEDGE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6827
    } else if ((aNumberOrSymbol == @symbol(SM_CXMINSPACING))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6828
	arg = SM_CXMINSPACING;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6829
    } else if ((aNumberOrSymbol == @symbol(SM_CYMINSPACING))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6830
	arg = SM_CYMINSPACING;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6831
    } else if ((aNumberOrSymbol == @symbol(SM_CXSMICON))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6832
	arg = SM_CXSMICON;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6833
    } else if ((aNumberOrSymbol == @symbol(SM_CYSMICON))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6834
	arg = SM_CYSMICON;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6835
    } else if ((aNumberOrSymbol == @symbol(SM_CYSMCAPTION))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6836
	arg = SM_CYSMCAPTION;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6837
    } else if ((aNumberOrSymbol == @symbol(SM_CXSMSIZE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6838
	arg = SM_CXSMSIZE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6839
    } else if ((aNumberOrSymbol == @symbol(SM_CYSMSIZE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6840
	arg = SM_CYSMSIZE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6841
    } else if ((aNumberOrSymbol == @symbol(SM_CXMENUSIZE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6842
	arg = SM_CXMENUSIZE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6843
    } else if ((aNumberOrSymbol == @symbol(SM_CYMENUSIZE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6844
	arg = SM_CYMENUSIZE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6845
    } else if ((aNumberOrSymbol == @symbol(SM_ARRANGE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6846
	arg = SM_ARRANGE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6847
    } else if ((aNumberOrSymbol == @symbol(SM_CXMINIMIZED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6848
	arg = SM_CXMINIMIZED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6849
    } else if ((aNumberOrSymbol == @symbol(SM_CYMINIMIZED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6850
	arg = SM_CYMINIMIZED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6851
    } else if ((aNumberOrSymbol == @symbol(SM_CXMAXTRACK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6852
	arg = SM_CXMAXTRACK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6853
    } else if ((aNumberOrSymbol == @symbol(SM_CYMAXTRACK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6854
	arg = SM_CYMAXTRACK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6855
    } else if ((aNumberOrSymbol == @symbol(SM_CXMAXIMIZED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6856
	arg = SM_CXMAXIMIZED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6857
    } else if ((aNumberOrSymbol == @symbol(SM_CYMAXIMIZED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6858
	arg = SM_CYMAXIMIZED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6859
    } else if ((aNumberOrSymbol == @symbol(SM_NETWORK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6860
	arg = SM_NETWORK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6861
    } else if ((aNumberOrSymbol == @symbol(SM_CXDRAG))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6862
	arg = SM_CXDRAG;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6863
    } else if ((aNumberOrSymbol == @symbol(SM_CYDRAG))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6864
	arg = SM_CYDRAG;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6865
    } else if ((aNumberOrSymbol == @symbol(SM_NETWORK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6866
	arg = SM_NETWORK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6867
    } else if ((aNumberOrSymbol == @symbol(SM_SHOWSOUNDS))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6868
	arg = SM_SHOWSOUNDS;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6869
    } else if ((aNumberOrSymbol == @symbol(SM_CXMENUCHECK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6870
	arg = SM_CXMENUCHECK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6871
    } else if ((aNumberOrSymbol == @symbol(SM_CYMENUCHECK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6872
	arg = SM_CYMENUCHECK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6873
    } else if ((aNumberOrSymbol == @symbol(SM_SLOWMACHINE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6874
	arg = SM_SLOWMACHINE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6875
    } else if ((aNumberOrSymbol == @symbol(SM_MIDEASTENABLED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6876
	arg = SM_MIDEASTENABLED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6877
    } else if ((aNumberOrSymbol == @symbol(SM_MOUSEWHEELPRESENT))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6878
	arg = SM_MOUSEWHEELPRESENT;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6879
    } else if ((aNumberOrSymbol == @symbol(SM_XVIRTUALSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6880
	arg = SM_XVIRTUALSCREEN;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6881
    } else if ((aNumberOrSymbol == @symbol(SM_YVIRTUALSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6882
	arg = SM_YVIRTUALSCREEN;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6883
    } else if ((aNumberOrSymbol == @symbol(SM_CXVIRTUALSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6884
	arg = SM_CXVIRTUALSCREEN;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6885
    } else if ((aNumberOrSymbol == @symbol(SM_CYVIRTUALSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6886
	arg = SM_CYVIRTUALSCREEN;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6887
    } else if ((aNumberOrSymbol == @symbol(SM_CMONITORS))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6888
	arg = SM_CMONITORS;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6889
    } else if ((aNumberOrSymbol == @symbol(SM_SAMEDISPLAYFORMAT))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6890
	arg = SM_SAMEDISPLAYFORMAT;
4092
9a7cf8cf8329 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4089
diff changeset
  6891
#ifdef SM_IMMENABLED
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6892
    } else if ((aNumberOrSymbol == @symbol(SM_IMMENABLED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6893
	arg = SM_IMMENABLED;
4092
9a7cf8cf8329 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4089
diff changeset
  6894
#endif
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6895
    } else if ((aNumberOrSymbol == @symbol(SM_DEBUG))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6896
	arg = SM_DEBUG;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6897
#ifdef SM_REMOTESESSION
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6898
    } else if ((aNumberOrSymbol == @symbol(SM_REMOTESESSION))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6899
	arg = SM_REMOTESESSION;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6900
#endif
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6901
    } else {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6902
	RETURN (nil);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6903
    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6904
    info = GetSystemMetrics(arg);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6905
    if (isBool) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6906
	RETURN (info ? true : false);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6907
    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6908
    RETURN (__MKSMALLINT(info));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6909
%}
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6910
    "
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6911
     Screen current getSystemMetrics:#SM_MOUSEWHEELPRESENT
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6912
     Screen current getSystemMetrics:#SM_ARRANGE
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  6913
     Screen current getSystemMetrics:#SM_XVIRTUALSCREEN
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  6914
     Screen current getSystemMetrics:#SM_CXVIRTUALSCREEN
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  6915
     Screen current getSystemMetrics:#SM_CYVIRTUALSCREEN
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  6916
     Screen current getSystemMetrics:#SM_CMONITORS
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  6917
     Screen current getSystemMetrics:#SM_SAMEDISPLAYFORMAT
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  6918
     Screen current getSystemMetrics:81
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  6919
    "
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  6920
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  6921
    "Modified: / 08-09-2006 / 15:36:32 / cg"
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6922
!
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6923
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6924
getSystemParametersInfo:aNumberOrSymbol
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6925
    "get a system parameter value;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6926
     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
  6927
     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
  6928
     which must be the define-value."
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6929
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6930
    | info menuFontInfoArray statusFontInfoArray messageFontInfoArray
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6931
      menuFont statusFont messageFont |
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6932
%{
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6933
    int retVal = 0;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6934
    int isBool = 0;
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6935
    int isString = 0;
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6936
    int isRect = 0;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6937
    int isNonClientInfo = 0;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6938
    int arg, param;
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6939
    void *pRslt;
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6940
    union {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6941
	char buffer[1024];
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6942
	RECT rect;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6943
	NONCLIENTMETRICS nc;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6944
    } rslt;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6945
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6946
    if (__isSmallInteger(aNumberOrSymbol)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6947
	arg = __intVal(aNumberOrSymbol);
4092
9a7cf8cf8329 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4089
diff changeset
  6948
#ifdef SPI_GETDESKWALLPAPER
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6949
    } else if (aNumberOrSymbol == @symbol(SPI_GETDESKWALLPAPER)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6950
	arg = SPI_GETDESKWALLPAPER;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6951
	isString = 1;
4092
9a7cf8cf8329 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4089
diff changeset
  6952
#endif
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6953
#ifdef SPI_GETDROPSHADOW
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6954
    } else if (aNumberOrSymbol == @symbol(SPI_GETDROPSHADOW)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6955
	arg = SPI_GETDROPSHADOW;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6956
	isBool = 1;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6957
#endif
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6958
#ifdef SPI_GETFLATMENU
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6959
    } else if (aNumberOrSymbol == @symbol(SPI_GETFLATMENU)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6960
	arg = SPI_GETFLATMENU;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6961
	isBool = 1;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6962
#endif
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6963
#ifdef SPI_GETWHEELSCROLLLINES
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6964
    } else if (aNumberOrSymbol == @symbol(SPI_GETWHEELSCROLLLINES)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6965
	arg = SPI_GETWHEELSCROLLLINES;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6966
#endif
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6967
#ifdef SPI_GETHOTTRACKING
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6968
    } else if (aNumberOrSymbol == @symbol(SPI_GETHOTTRACKING)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6969
	arg = SPI_GETHOTTRACKING;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6970
	isBool = 1;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6971
#endif
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6972
#ifdef SPI_GETTOOLTIPANIMATION
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6973
    } else if (aNumberOrSymbol == @symbol(SPI_GETTOOLTIPANIMATION)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6974
	arg = SPI_GETTOOLTIPANIMATION;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6975
	isBool = 1;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6976
#endif
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6977
#ifdef SPI_GETWORKAREA
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6978
    } else if (aNumberOrSymbol == @symbol(SPI_GETWORKAREA)) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6979
	arg = SPI_GETWORKAREA;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6980
	isRect = 1;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6981
#endif
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6982
#ifdef SPI_GETNONCLIENTMETRICS
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6983
    } else if (aNumberOrSymbol == @symbol(SPI_GETNONCLIENTMETRICS)) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6984
	arg = SPI_GETNONCLIENTMETRICS;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6985
	rslt.nc.cbSize = sizeof ( rslt.nc ) ;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6986
	isNonClientInfo = 1;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6987
#endif
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6988
    } else {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6989
	RETURN (nil);
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6990
    }
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6991
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6992
    param = 0;
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6993
    pRslt = (void *)&rslt;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6994
    if (isString) {
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6995
	param = sizeof(rslt);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6996
    }
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6997
    retVal = SystemParametersInfo(arg, param, pRslt, 0);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6998
    if (! retVal) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6999
	RETURN (nil);
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  7000
    }
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  7001
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  7002
    if (isBool) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  7003
	RETURN (info ? true : false);
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  7004
    }
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  7005
    if (isString) {
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7006
	RETURN (__MKSTRING(rslt.buffer));
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7007
    }
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7008
    if (isRect) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7009
	RETURN ( __SSEND4(__DEF_Rectangle, @symbol(left:top:right:bottom:), 0,
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7010
			__MKSMALLINT(rslt.rect.left),
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7011
			__MKSMALLINT(rslt.rect.top),
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7012
			__MKSMALLINT(rslt.rect.right),
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7013
			__MKSMALLINT(rslt.rect.bottom)) );
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7014
    }
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7015
    if (isNonClientInfo) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7016
	menuFontInfoArray = __extractLogicalFontParameters(&rslt.nc.lfMenuFont);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7017
	statusFontInfoArray = __extractLogicalFontParameters(&rslt.nc.lfStatusFont);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7018
	messageFontInfoArray = __extractLogicalFontParameters(&rslt.nc.lfMessageFont);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7019
    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7020
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7021
   out: ;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7022
%}.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7023
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7024
    menuFontInfoArray notNil ifTrue:[
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7025
	menuFont := self fontDescriptionFromLogicalFontInfoArray:menuFontInfoArray.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7026
	statusFont := self fontDescriptionFromLogicalFontInfoArray:statusFontInfoArray.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7027
	messageFont := self fontDescriptionFromLogicalFontInfoArray:messageFontInfoArray.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7028
	^ (Dictionary new)
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7029
	    at:#menuFont put:menuFont;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7030
	    at:#statusFont put:statusFont;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7031
	    at:#messageFont put:messageFont;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7032
	    yourself.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7033
    ].
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7034
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7035
    ^ nil
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  7036
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  7037
    "
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  7038
     Screen current getSystemParametersInfo:#SPI_GETDESKWALLPAPER
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  7039
     Screen current getSystemParametersInfo:#SPI_GETDROPSHADOW
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7040
     Screen current getSystemParametersInfo:#SPI_GETFLATMENU
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7041
     Screen current getSystemParametersInfo:#SPI_GETWHEELSCROLLLINES
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7042
     Screen current getSystemParametersInfo:#SPI_GETHOTTRACKING
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7043
     Screen current getSystemParametersInfo:#SPI_GETTOOLTIPANIMATION
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7044
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7045
     Screen current getSystemParametersInfo:#SPI_GETWORKAREA
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7046
     Screen current getSystemParametersInfo:#SPI_GETNONCLIENTMETRICS
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  7047
    "
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7048
!
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7049
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7050
ignoreButtonPressOnActivate:aBoolean
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7051
    "set/clear the ignoreButtonPressOnActivate behavior.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7052
     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
  7053
     and not passed to the window.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7054
     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
  7055
     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
  7056
     activation.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7057
     Returns the previous setting."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7058
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7059
%{  /* NOCONTEXT */
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7060
    OBJ rslt = __ignoreButtonPressOnActivate ? true : false;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7061
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7062
    if (aBoolean == true) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7063
       __ignoreButtonPressOnActivate = 1;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7064
    } else {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7065
       if (aBoolean == false) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7066
	   __ignoreButtonPressOnActivate = 0;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7067
       }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7068
    }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7069
    RETURN (rslt);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7070
%}
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7071
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7072
     WinWorkstation ignoreButtonPressOnActivate:true
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7073
     WinWorkstation ignoreButtonPressOnActivate:false
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7074
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7075
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7076
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7077
monitorInfoFor:aMonitorId
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7078
    "given a monitor handle (as returned by monitorHandleForXXX), return its info"
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7079
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7080
    |screenL screenT screenR screenB screenW screenH
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7081
     workL workT workR workB workW workH
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7082
     isPrimary mName|
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7083
%{
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7084
    if (__isExternalAddress(aMonitorId)) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7085
	HMONITOR hMonitor = _HWNDVal(aMonitorId);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7086
	MONITORINFOEX info;
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7087
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7088
	info.cbSize = sizeof(MONITORINFOEX);
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7089
#if 0
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7090
	static BOOL (__stdcall *P_GetMonitorInfo)(HMONITOR , MONITORINFOEX *);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7091
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7092
	if (P_GetMonitorInfo == 0) {
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7093
	    HINSTANCE hUser = LoadLibrary("user32.dll");
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7094
	    // console_printf("hUser: %x\n", hUser);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7095
	    if (hUser) {
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7096
		P_GetMonitorInfo = (BOOL (__stdcall *)(HMONITOR, MONITORINFOEX * ))
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7097
				    GetProcAddress(hUser, "GetMonitorInfo");
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7098
	    }
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7099
	}
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7100
	console_printf("P_GetMonitorInfo: %x\n", P_GetMonitorInfo);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7101
	if ((*P_GetMonitorInfo)(hMonitor, &info))
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7102
#else
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7103
	if (GetMonitorInfo(hMonitor, &info))
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7104
#endif
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7105
	{
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7106
	    // console_printf("l %d\n", info.rcMonitor.left);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7107
	    screenL = __MKSMALLINT(info.rcMonitor.left);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7108
	    screenT = __MKSMALLINT(info.rcMonitor.top);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7109
	    screenR = __MKSMALLINT(info.rcMonitor.right);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7110
	    screenB = __MKSMALLINT(info.rcMonitor.bottom);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7111
	    workL = __MKSMALLINT(info.rcWork.left);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7112
	    workT = __MKSMALLINT(info.rcWork.top);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7113
	    workR = __MKSMALLINT(info.rcWork.right);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7114
	    workB = __MKSMALLINT(info.rcWork.bottom);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7115
	    isPrimary = (info.dwFlags & MONITORINFOF_PRIMARY) ? true : false;
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7116
	    info.szDevice[31] = '\0';
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7117
	    mName = __MKSTRING(info.szDevice);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7118
	}
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7119
    }
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7120
%}.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7121
    screenL isNil ifTrue:[ ^ nil ].
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7122
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7123
    ^ MonitorInfo new
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7124
	screenX:screenL screenY:screenT
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7125
	screenWidth:(screenR-screenL) screenHeight:(screenB-screenT)
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7126
	workX:workL workY:workT
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7127
	workWidth:(workR-workL) workHeight:(workB-workT)
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7128
	isPrimary:isPrimary
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7129
	name:mName
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7130
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7131
    "
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7132
     Screen current monitorInfoFor:(Screen current monitorHandleForView:(Transcript topView id))
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7133
     Screen current monitorInfoFor:(Screen current monitorHandleForPoint:(0@0))
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7134
    "
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7135
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7136
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7137
primViewIdFromPoint:aPoint in:windowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7138
    "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
  7139
     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
  7140
     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
  7141
     - 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
  7142
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7143
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7144
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7145
    OBJ xp, yp;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7146
    int xpos, ypos;
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  7147
    HWND child_ret;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7148
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7149
    if (ISCONNECTED
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7150
     && __isExternalAddress(windowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7151
     && __isPoint(aPoint))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7152
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7153
	xp = _point_X(aPoint);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7154
	yp = _point_Y(aPoint);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7155
	if (__bothSmallInteger(xp, yp))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7156
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7157
	    POINT p;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7158
	    HWND hWnd = _HWNDVal(windowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7159
	    p.x = __intVal(xp);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7160
	    p.y = __intVal(yp);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7161
	    ScreenToClient(hWnd, &p);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  7162
	    child_ret = ChildWindowFromPointEx(hWnd,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  7163
	    /*console_printf("ChildWindow From %x Point %d.%d = %x\n",hWnd,p.x,p.y,child_ret);*/
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  7164
	    if ((child_ret) && (child_ret != hWnd))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7165
	    {
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  7166
		RETURN ( __MKEXTERNALADDRESS(child_ret) );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7167
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7168
	    RETURN ( nil );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7169
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7170
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7171
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7172
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7173
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7174
prim_getWindowRect:hWnd
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7175
    |l r t b|
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7176
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7177
%{
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7178
    if (__isExternalAddress(hWnd) || __isExternalBytesLike(hWnd)) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7179
	HANDLE _hwnd = __externalAddressVal(hWnd);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7180
	RECT rect;
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7181
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7182
	if (GetWindowRect(_hwnd, &rect)) {
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7183
	    l = __MKSMALLINT(rect.left);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7184
	    r = __MKSMALLINT(rect.right);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7185
	    t = __MKSMALLINT(rect.top);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7186
	    b = __MKSMALLINT(rect.bottom);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7187
	}
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7188
    }
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7189
%}.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7190
    l isNil ifTrue:[
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7191
	self primitiveFailed.
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7192
    ].
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7193
    ^ l@t corner:r@b
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7194
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7195
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7196
protocolVersion
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7197
    "return the displays protocol version.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7198
     For Windows, a dummy number is returned"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7199
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7200
    ^ '1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7201
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7202
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7203
     Display protocolVersion
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7204
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7205
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7206
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7207
rightButtonIsLowerWindow:aBoolean
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7208
    "set/clear the rightButtonIsLowerWindow behavior.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7209
     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
  7210
     window.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7211
     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
  7212
     and not provided by the standard windows applications.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7213
     Returns the previous setting."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7214
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7215
%{  /* NOCONTEXT */
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7216
    OBJ rslt = __rightButtonIsLowerWindow ? true : false;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7217
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7218
    if (aBoolean == true) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7219
       __rightButtonIsLowerWindow = 1;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7220
    } else {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7221
       if (aBoolean == false) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7222
	   __rightButtonIsLowerWindow = 0;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7223
       }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7224
    }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7225
    RETURN (rslt);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7226
%}
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7227
    "
5440
9f158dcd32e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5372
diff changeset
  7228
     Display rightButtonIsLowerWindow:true
9f158dcd32e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5372
diff changeset
  7229
     Display rightButtonIsLowerWindow:false
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7230
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7231
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7232
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7233
serverVendor
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7234
    "return the server vendor string.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7235
     For Windows, a dummy name is returned"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7236
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7237
    ^ 'microsoft'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7238
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7239
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7240
     Display serverVendor
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7241
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7242
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7243
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7244
shiftMask
3261
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7245
    "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
  7246
     Obsolete"
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7247
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7248
%{  /* NOCONTEXT */
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7249
    RETURN (__MKSMALLINT(ShiftMask));
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7250
%}
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7251
!
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7252
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7253
shiftModifierMask
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7254
    "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
  7255
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7256
%{  /* NOCONTEXT */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7257
    RETURN (__MKSMALLINT(ShiftMask));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7258
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7259
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7260
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7261
shiftedLeftButtonIsLowerWindow:aBoolean
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7262
    "set/clear the shiftedLeftButtonIsLowerWindow behavior.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7263
     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
  7264
     window.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7265
     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
  7266
     and not provided by the standard windows applications.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7267
     Notice, this duplicates the rightButtonIsLowerWindow behavior,
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7268
     but is useful with single-button mice.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7269
     Returns the previous setting."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7270
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7271
%{  /* NOCONTEXT */
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7272
    OBJ rslt = __shiftedLeftButtonIsLowerWindow ? true : false;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7273
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7274
    if (aBoolean == true) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7275
       __shiftedLeftButtonIsLowerWindow = 1;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7276
    } else {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7277
       if (aBoolean == false) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7278
	   __shiftedLeftButtonIsLowerWindow = 0;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7279
       }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7280
    }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7281
    RETURN (rslt);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7282
%}
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7283
    "
5440
9f158dcd32e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5372
diff changeset
  7284
     Display shiftedLeftButtonIsLowerWindow:true
9f158dcd32e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5372
diff changeset
  7285
     Display shiftedLeftButtonIsLowerWindow:false
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7286
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7287
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7288
2682
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7289
supportedSystemColorKeys
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7290
    "return a collection of supported systemColor keys"
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7291
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7292
    ^#(
2682
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7293
	COLOR_WINDOW
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7294
	COLOR_WINDOWTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7295
	COLOR_MENU
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7296
	COLOR_MENUTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7297
	COLOR_BTNFACE
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7298
	COLOR_BTNSHADOW
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7299
	COLOR_BTNTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7300
	COLOR_GRAYTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7301
	COLOR_HIGHLIGHT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7302
	COLOR_HIGHLIGHTTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7303
	COLOR_MENU
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7304
	COLOR_MENUTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7305
	COLOR_SCROLLBAR
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7306
	COLOR_SHADOW
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7307
    )
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7308
!
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7309
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7310
translatePoint:aPoint from:windowId1 to:windowId2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7311
    "given a point in window1, return the coordinate in window2.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7312
     This expects a device coordinate (relative to the first views origin)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7313
     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
  7314
     - use to xlate points from a window to rootwindow"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7315
2276
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7316
    |x1 y1 x2 y2|
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7317
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7318
    x1 := x2 := aPoint x truncated.
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7319
    y1 := y2 := aPoint y truncated.
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7320
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7321
%{
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7322
    HWND w1, w2;
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7323
    POINT point;
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7324
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7325
    if (__isExternalAddress(windowId1)
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7326
     && __isExternalAddress(windowId2)
2279
30a35be06995 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2276
diff changeset
  7327
     && __bothSmallInteger(x1, y1)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  7328
	w1 = _HWNDVal(windowId1);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  7329
	w2 = _HWNDVal(windowId2);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  7330
	point.x = __intVal(x1);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  7331
	point.y = __intVal(y1);
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  7332
	CPRINTF(("TransPoint %x %d/%d ->",w1,point.x,point.y));
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7333
	if (ClientToScreen(w1,&point) == FALSE) {
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7334
	    RETURN (nil);
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7335
	}
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7336
	if (ScreenToClient(w2,&point) == FALSE) {
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7337
	    RETURN (nil);
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7338
	}
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  7339
	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
  7340
	RETURN (__MKPOINT_INT(point.x, point.y));
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  7341
    }
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  7342
    RETURN (nil);
2276
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7343
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7344
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7345
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7346
vendorRelease
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7347
    "return the display-servers vendor release
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7348
     - should normally not be of any interest,
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7349
     but may be usefule for special cases.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7350
     (to avoid bugs in certain implementations / releases)"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7351
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7352
    ^ 1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7353
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7354
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7355
     Display vendorRelease
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7356
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7357
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7358
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7359
viewIdFromPoint:aPoint in:windowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7360
    "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
  7361
     hit by this coordinate. Return nil if no view was hit.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7362
     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
  7363
     - used to find the window to drop objects after a cross-view drag."
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7364
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7365
    windowId notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7366
	aPoint isPoint ifTrue:[
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7367
	    "/(aPoint x > 30000) ifTrue:[self halt.].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7368
	    "/(aPoint y > 30000) ifTrue:[self halt.].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7369
	    "/aPoint printString errorPrintCR.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7370
	    ^ self primViewIdFromPoint:aPoint asPoint truncated in:windowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7371
	]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7372
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7373
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7374
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7375
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7376
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7377
whitepixel
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7378
    "return the colornumber of white"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7379
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7380
    ^ whitepixel
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7381
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7382
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7383
!WinWorkstation methodsFor:'accessing display capabilities'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7384
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7385
captionHeight
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7386
    "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
  7387
     standard topWindows."
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7388
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7389
    ^ self getSystemMetrics:#SM_CYCAPTION
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7390
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7391
    "Modified: / 08-09-2006 / 15:39:24 / cg"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7392
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7393
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7394
iconSizes
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7395
    "Get the preferred/supported icon sizes."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7396
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7397
    |d w h|
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7398
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7399
    w := self getSystemMetrics:#SM_CXICON.
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7400
    h := self getSystemMetrics:#SM_CYICON.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7401
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7402
    d := IdentityDictionary new.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7403
    d at:#minWidth put:w.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7404
    d at:#maxWidth put:h.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7405
    d at:#widthStep put:1.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7406
    d at:#minHeight put:w.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7407
    d at:#maxHeight put:h.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7408
    d at:#heightStep put:1.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7409
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7410
    ^ OrderedCollection with:d
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7411
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7412
    "
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7413
     Display iconSizes
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7414
    "
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7415
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7416
    "Modified: / 08-09-2006 / 15:40:18 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7417
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7418
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7419
preferredIconSize
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7420
    "Get the preferrered icon size.
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7421
     Here, workaround windows (bug?) which returns 32@32
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7422
     although, 20@20 is much nicer"
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7423
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7424
    ^ 20@20
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7425
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7426
    "
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7427
     Display preferredIconSize
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7428
    "
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7429
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7430
    "Modified: / 28.9.1998 / 13:49:54 / cg"
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7431
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7432
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7433
scrollsAsynchronous
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7434
    "return true, if this display asynchronously sends expose events after a
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7435
     scroll operation. False otherwise. Asynchronous expose events are an X
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7436
     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
  7437
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7438
    ^ true "/ false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7439
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7440
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7441
supportedImageFormats
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7442
    "return an array with supported image formats; each array entry
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7443
     is another array, consisting of depth and bitsPerPixel values."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7444
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7445
    |info|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7446
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7447
    info := IdentityDictionary new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7448
    info at:#depth put:depth.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7449
    info at:#bitsPerPixel put:depth.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7450
    info at:#padding put:32.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7451
    ^ Array with:info
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7452
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7453
    "
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7454
     Disply supportedImageFormats
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7455
    "
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7456
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7457
    "Modified: / 10.9.1998 / 23:14:05 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7458
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7459
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7460
supportsDeepIcons
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7461
    "return true, if this device supports deepicons."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7462
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7463
    ^ true
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7464
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7465
2604
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7466
supportsIconMasks
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7467
    "return true, if this device supports masked icons.
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7468
     For now, return false since somehow icons are inverted
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7469
     if we use masks (and I dont know yet why)."
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7470
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7471
    ^ false
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7472
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7473
    "
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7474
     Display supportsIconMasks
2604
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7475
    "
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7476
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7477
    "Modified: / 28.4.1999 / 19:59:17 / cg"
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7478
!
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7479
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7480
supportsIconViews
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7481
    "return true, if this device supports views as icons."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7482
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7483
    ^ false "/ true
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7484
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7485
    "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7486
     Display supportsIconViews
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7487
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7488
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7489
    "Modified: 10.6.1996 / 20:11:48 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7490
    "Created: 10.6.1996 / 21:08:18 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7491
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7492
2632
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  7493
supportsMaskedDrawingWith:aForm
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  7494
    "return true, if the device allows the given form pixmap
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7495
     to be used as paint color.
2632
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  7496
     Sorry - win95 only supports 8x8 masks."
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  7497
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  7498
    isWin95 ifFalse:[
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  7499
	^ true
2632
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  7500
    ].
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  7501
    ^ (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
  7502
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  7503
    "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
  7504
    "Modified: / 4.5.1999 / 12:58:31 / cg"
2339
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  7505
!
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  7506
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7507
supportsViewBackgroundPixmap:aForm
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7508
    "return true, if the device allows the given pixmap as
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7509
     viewBackground. If false is returned,
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7510
     drawing is done by (possibly) slower smalltalk code.
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7511
     Sorry - win95 only supports 8x8 masks."
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7512
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7513
    isWin95 ifFalse:[
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7514
	^ true
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7515
    ].
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7516
    ^ (aForm width == 8) and:[aForm height == 8]
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7517
!
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7518
2908
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7519
supportsWindowBorder:aNumber
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7520
    "return true, if this device supports bordered windows.
3109
f29d9b8a978d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3080
diff changeset
  7521
     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
  7522
     to be supported by the device.
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7523
     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
  7524
     future. (Windows only supports borders 1 and noBorder)"
f29d9b8a978d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3080
diff changeset
  7525
f29d9b8a978d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3080
diff changeset
  7526
    ^ (aNumber ? 0) <= 1
2908
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7527
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7528
    "
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7529
     Display supportsWindowBorder:1
2908
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7530
    "
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7531
!
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7532
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7533
usableExtent
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7534
    "return the usable extent of the display (in pixels).
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7535
     Normally, the same as extent, but may be smaller, in
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7536
     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
  7537
4576
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7538
    |wSingle hSingle w h dx dy|
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7539
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7540
    w := wSingle := self getSystemMetrics:#SM_CXFULLSCREEN.
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7541
    h := hSingle := self getSystemMetrics:#SM_CYFULLSCREEN.
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7542
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7543
    (self getSystemMetrics:#SM_CMONITORS) > 1 ifTrue:[
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7544
	w := self getSystemMetrics:#SM_CXVIRTUALSCREEN.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7545
	h := self getSystemMetrics:#SM_CYVIRTUALSCREEN.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7546
	(w isNil or:[h isNil]) ifTrue:[
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7547
	    "/ not supported under win95 and win-nt4 - fallback to real extent
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7548
	    w := wSingle.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7549
	    h := hSingle.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7550
	] ifFalse:[
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7551
	    dx := (self getSystemMetrics:#SM_CXSCREEN) - wSingle.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7552
	    dy := (self getSystemMetrics:#SM_CYSCREEN) - hSingle.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7553
	    w := w - dx.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7554
	    h := h - dy - 8.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7555
	].
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7556
    ].
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7557
    ^ w @ h.
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7558
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7559
    "
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7560
     Display usableExtent
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7561
     Display getSystemMetrics:#SM_CYVIRTUALSCREEN
4576
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7562
     Display getSystemMetrics:#SM_CYFULLSCREEN
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7563
     Display getSystemMetrics:#SM_CYSCREEN
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7564
     Display getSystemMetrics:#SM_CMONITORS
4576
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7565
    "
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7566
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7567
    "Modified: / 08-09-2006 / 18:19:22 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7568
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7569
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7570
!WinWorkstation methodsFor:'bitmap/window creation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7571
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7572
addMenuItemWithLabel:aString toWindowID:aWindowId
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7573
    "not yet"
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7574
%{
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7575
#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
  7576
    if (__isExternalAddress(aWindowId)) {
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7577
	HWND hWin = _HWNDVal(aWindowId);
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7578
	HMENU hMenu;
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7579
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7580
	hMenu = GetMenu(hWin);
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7581
	if (hMenu) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7582
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7583
	}
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7584
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7585
#endif
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7586
%}
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7587
!
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7588
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7589
createBitmapFromArray:anArray width:w height:h
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7590
    |bitmapId|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7591
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7592
    bitmapId := self primCreateBitmapFromArray:anArray width:w height:h.
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7593
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7594
    bitmapId isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7595
	'WINWORKSTATION: cannot create bitmap' errorPrintCR.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7596
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7597
    ^ bitmapId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7598
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7599
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7600
createBitmapWidth:w height:h
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7601
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7602
%{
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7603
    HANDLE newBitmapHandle;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7604
    int b_width, b_height;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7605
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7606
    if (__bothSmallInteger(w, h)) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7607
	b_width = __intVal(w);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7608
	b_height = __intVal(h);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7609
	newBitmapHandle = CreateBitmap(b_width, b_height, 1, 1, NULL);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7610
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7611
	if (newBitmapHandle) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7612
#ifdef COUNT_BMP_RESOURCES
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7613
	    __cnt_bitmap++;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7614
	    RES_BMP_PRINTF(("CreateBitmap %x %d\n",newBitmapHandle, __cnt_bitmap));
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7615
#endif
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7616
	    RETURN ( __MKOBJ(newBitmapHandle));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7617
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7618
	DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7619
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7620
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7621
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7622
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7623
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7624
createPixmapWidth:w height:h depth:d
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7625
    "allocate a pixmap on the Xserver, the contents is undefined
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7626
     (i.e. random). Return a bitmap id or nil"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7627
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7628
%{
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7629
    HANDLE newBitmapHandle;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7630
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  7631
    /*console_printf("CreateBitmap Color\n");*/
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7632
    if (__bothSmallInteger(w, h) && __isSmallInteger(d) && ISCONNECTED) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7633
	if (__intVal(d) == 1) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7634
	    newBitmapHandle = CreateBitmap(__intVal(w), __intVal(h) , 1, 1, NULL);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7635
	} else {
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  7636
#if 0
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7637
	    if (__intVal(d) != __depth) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  7638
		console_printf("invalid depth\n");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7639
		RETURN (nil);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7640
	    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7641
#endif
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7642
	    newBitmapHandle = CreateCompatibleBitmap(__rootDC, __intVal(w), __intVal(h) );
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7643
	}
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7644
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7645
	if (newBitmapHandle) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7646
#ifdef COUNT_BMP_RESOURCES
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7647
	    __cnt_bitmap++;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7648
	    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
  7649
#endif
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7650
	    RETURN ( __MKOBJ(newBitmapHandle));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7651
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7652
	DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7653
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7654
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7655
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7656
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7657
1467
9629ce710c53 added type argument to createWindowFor - prepare for native window support (windows)
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  7658
createWindowFor:aView type:typeSymbol
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7659
		 origin:origin
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7660
		 extent:extent
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7661
		 minExtent:minExt
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7662
		 maxExtent:maxExt
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7663
		 borderWidth:bWidth
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7664
		 subViewOf:wsuperView
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7665
		 style:wStyle
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7666
		 inputOnly:winputOnly
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7667
		 label:wlabel
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7668
		 owner:wowner
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7669
		 icon:wicon
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7670
		 iconMask:wiconMaskArg
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7671
		 iconView:wiconView
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7672
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7673
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7674
    |xpos ypos wwidth wheight minWidth minHeight maxWidth maxHeight
4326
2c828f8b5173 fixed iconMask
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  7675
     wsuperViewId wiconId wiconMask invertedWiconMask wiconMaskId windowId
2c828f8b5173 fixed iconMask
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  7676
     weventMask wiconWidth wiconHeight windowType windowClass moreArgs|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7677
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7678
    "/ bColorId wiconViewId bitGravity vBgColor vBgForm deepForm
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7679
    "/  preferredVisual preferredDepth  viewGravity wcursorId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7680
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7681
    displayId isNil ifTrue:[
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7682
	self primitiveFailed.
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7683
	^ nil
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7684
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7685
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7686
    origin notNil ifTrue:[
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7687
	xpos := origin x.
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7688
	ypos := origin y.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7689
    ] ifFalse:[
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7690
	xpos := ypos := 0.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7691
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7692
    extent notNil ifTrue:[
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7693
	wwidth := extent x.
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7694
	wheight := extent y.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7695
    ] ifFalse:[
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7696
	wwidth := 100.
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7697
	wheight := 40.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7698
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7699
    minExt notNil ifTrue:[
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7700
	minWidth := minExt x.
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7701
	minHeight := minExt y
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7702
    ] ifFalse:[
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7703
	minWidth := 1.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7704
	minHeight := 1.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7705
    ].
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7706
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7707
    maxExt notNil ifTrue:[
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7708
	maxWidth := maxExt x.
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7709
	maxHeight := maxExt y
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7710
    ] ifFalse:[
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7711
	maxWidth := width.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7712
	maxHeight := height.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7713
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7714
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7715
    wsuperView notNil ifTrue:[
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7716
	wsuperViewId := wsuperView id
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7717
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7718
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7719
    wicon notNil ifTrue:[
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7720
	wiconId := wicon id.
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7721
	wiconHeight := wicon height.
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7722
	wiconWidth  := wicon width.
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7723
	wiconMask := wiconMaskArg.
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7724
	wiconMask isNil ifTrue:[
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7725
	    wiconMask := wicon mask.
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7726
	].
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7727
	wiconMask notNil ifTrue:[
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7728
	    "/ WIN32's mask has zeros for opaque pixels
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7729
	    invertedWiconMask := wiconMask copy.
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7730
	    invertedWiconMask bits invert.
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7731
	    invertedWiconMask := invertedWiconMask onDevice:self.
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7732
	    wiconMaskId := invertedWiconMask id
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7733
	].
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7734
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7735
"/    wiconView notNil ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7736
"/        wiconViewId := wiconView id
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7737
"/    ].
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7738
    weventMask := aView eventMask.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7739
4261
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  7740
    NativeWidgets ifTrue:[
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7741
	windowType := aView nativeWindowType.
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7742
	windowType notNil ifTrue:[
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7743
	    "/ must be a symbol and is used
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7744
	    "/ as a key into the nativeClass translation map.
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7745
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7746
	    windowClass := NativeWidgetClassTable at:windowType ifAbsent:windowType.
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7747
	    self class debugNative ifTrue:[
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7748
		'WinWorkstation [info]: windowType: ' infoPrint. windowType infoPrint.
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7749
		' windowClass: ' infoPrint. windowClass infoPrintCR.
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7750
	    ].
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7751
	].
4262
129e10b82f57 *** empty log message ***
ca
parents: 4261
diff changeset
  7752
    ].
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  7753
    aView isMDIClientView ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  7754
	windowClass := 'mdiclient'.
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  7755
    ].
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  7756
4262
129e10b82f57 *** empty log message ***
ca
parents: 4261
diff changeset
  7757
    windowClass notNil ifTrue:[
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7758
	aView beNativeWidget.
4262
129e10b82f57 *** empty log message ***
ca
parents: 4261
diff changeset
  7759
    ] ifFalse:[
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7760
	aView beNonNativeWidget.
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7761
    ].
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7762
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7763
    moreArgs := Array new:20.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7764
    moreArgs at:1 put:xpos.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7765
    moreArgs at:2 put:ypos.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7766
    moreArgs at:3 put:wwidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7767
    moreArgs at:4 put:wheight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7768
    moreArgs at:5 put:minWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7769
    moreArgs at:6 put:minHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7770
    moreArgs at:7 put:maxWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7771
    moreArgs at:8 put:maxHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7772
    moreArgs at:9 put:wsuperViewId.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7773
    moreArgs at:10 put:nil. "/ wcursorId.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7774
    moreArgs at:11 put:wiconId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7775
    moreArgs at:12 put:wiconMaskId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7776
    moreArgs at:13 put:wiconWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7777
    moreArgs at:14 put:wiconHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7778
    moreArgs at:15 put:windowType.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7779
    moreArgs at:16 put:windowClass.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7780
    moreArgs at:17 put:weventMask.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7781
    moreArgs at:18 put:(aView className asString).
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7782
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7783
    [
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7784
      windowId := self
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7785
		  primCreateWindowFor:aView
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7786
		  type:typeSymbol
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7787
		  borderWidth:bWidth
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7788
		  subViewOf:wsuperView
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7789
		  style:wStyle
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7790
		  inputOnly:winputOnly
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7791
		  label:wlabel
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7792
		  owner:wowner
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7793
		  icon:wicon
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7794
		  iconMask:wiconMask
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
  7795
		  moreArgs:moreArgs.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7796
      aView setId:windowId.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7797
    ] valueUninterruptably.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7798
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7799
    windowId notNil ifTrue:[self addKnownView:aView withId:windowId].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7800
    ^ windowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7801
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7802
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7803
destroyGC:aGCId
4478
fb57ec7d7cc4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
  7804
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7805
    if (__isExternalAddress(aGCId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7806
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7807
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7808
	if (gcData == NULL) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  7809
	    console_fprintf(stderr, "WinWorkstation [warning]: trying to destroy GC twice\n");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7810
	    RETURN(self);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7811
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7812
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7813
#ifdef COUNT_RESOURCES
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7814
	 __cnt_gcData--;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7815
	RESPRINTF(("DestroyGcData %d\n",__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7816
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7817
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7818
#ifdef CACHE_LAST_DC
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7819
	if (lastGcData == gcData) {
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  7820
	    _releaseDC(gcData);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7821
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7822
#endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7823
	__ExternalAddressInstPtr(aGCId)->e_address = NULL;
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  7824
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  7825
	freeGcData(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7826
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7827
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7828
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7829
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7830
destroyPixmap:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7831
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7832
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7833
    if (__isExternalAddress(aDrawableId) && ISCONNECTED) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7834
	HANDLE bitmapHandle = _HANDLEVal(aDrawableId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7835
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7836
	if (bitmapHandle) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7837
#ifdef COUNT_BMP_RESOURCES
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7838
	    __cnt_bitmap--;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7839
	    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
  7840
#endif
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  7841
	    _DeleteObject(bitmapHandle, __LINE__);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7842
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7843
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7844
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7845
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7846
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7847
destroyView:aView withId:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7848
    self primDestroyView:aView withId:aWindowId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7849
    self removeKnownView:aView withId:aWindowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7850
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7851
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7852
gcFor:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7853
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7854
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7855
    HWND hWnd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7856
    struct gcData *gcData;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7857
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7858
    if (__isExternalAddress(aDrawableId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7859
	hWnd = _HWNDVal(aDrawableId);
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7860
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7861
	if (! hWnd) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7862
	    RETURN (nil);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7863
	}
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7864
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7865
	gcData = newGcData();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7866
	if (! gcData) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7867
	    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7868
	}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7869
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7870
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7871
	__cnt_gcData++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7872
	RESPRINTF(("CreateGcData %d\n",__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7873
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7874
	gcData->hWnd = hWnd;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7875
	gcData->_hDC = 0;
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  7876
	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
  7877
	RETURN ( __MKOBJ(gcData) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7878
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7879
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7880
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7881
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7882
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7883
gcForBitmap:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7884
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7885
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7886
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7887
    if (__isExternalAddress(aDrawableId)) {  /* HBITMAP */
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7888
	struct gcData *gcData;
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7889
	BITMAP bitmap;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7890
	HBITMAP hBitmap = _HBITMAPVAL(aDrawableId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7891
	HDC hDC;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7892
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7893
	if (! hBitmap) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7894
	    RETURN (nil);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7895
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7896
	gcData = newGcData();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7897
	if (! gcData) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7898
	    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7899
	}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  7900
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7901
	if (GetObject(hBitmap, sizeof(bitmap), &bitmap)) {
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  7902
	    DDPRINTF(("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
  7903
	} else {
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  7904
	    DPRINTF(("noinfo returned for bitmap\n"));
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7905
	    /* mhmh - can this happen ? */
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7906
	    bitmap.bmBitsPixel = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7907
	}
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  7908
	gcData->hBitmap = hBitmap;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7909
	gcData->bitmapColorBitCount = bitmap.bmBitsPixel;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7910
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7911
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7912
	__cnt_gcData++;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7913
	RESPRINTF(("CreateGcData %d\n", __cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7914
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7915
	RETURN ( __MKOBJ(gcData) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7916
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7917
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7918
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7919
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7920
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7921
gcForHDC: aDeviceContextHandle
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7922
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7923
%{  /* NOCONTEXT */
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7924
    HDC hDC;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7925
    struct gcData *gcData;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7926
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7927
    if (__isExternalAddressLike(aDeviceContextHandle)) {
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7928
	hDC = _HDCVal(aDeviceContextHandle);
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7929
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7930
	if (! hDC) {
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7931
	    RETURN (nil);
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7932
	}
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7933
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7934
	gcData = newGcData();
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7935
	if (! gcData) {
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7936
	    RETURN (nil);
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7937
	}
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7938
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7939
#ifdef COUNT_RESOURCES
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7940
	__cnt_gcData++;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7941
	RESPRINTF(("CreateGcData %d\n",__cnt_gcData));
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7942
#endif
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7943
	gcData->_hDC = hDC;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7944
	gcData->doNotCacheOrRelease = 1;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7945
	CPRINTF(("gcFor hDC=%x hWnd=%x\n",gcData->_hDC,gcData->hWnd));
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7946
	RETURN ( __MKOBJ(gcData) );
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7947
    }
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7948
    RETURN (nil);
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7949
%}
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7950
!
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  7951
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7952
primCreateBitmapFromArray:anArray width:w height:h
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7953
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7954
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7955
    HBITMAP newBitmapHandle;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7956
    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
  7957
    int row, col;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7958
    unsigned char *cp, *bPits;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7959
    unsigned char *b_bits = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7960
    int index;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7961
    OBJ num;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7962
    unsigned char *allocatedBits = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7963
    unsigned char fastBits[10000];
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7964
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7965
    if (__bothSmallInteger(w, h)
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7966
     && _isNonNilObject(anArray)) {
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7967
	OBJ cls = __qClass(anArray);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7968
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7969
	b_width = __intVal(w);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7970
	b_height = __intVal(h);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7971
	bytesPerRowST = (b_width + 7) / 8;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7972
	bytesPerRowWN = ((b_width + 15) / 16) * 2;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7973
	padding = bytesPerRowWN - bytesPerRowST;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7974
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
  7975
	if ((padding == 0) && (__isByteArrayLike(anArray))) {
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7976
	    b_bits = __ByteArrayInstPtr(anArray)->ba_element;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7977
	    cp = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7978
	} else {
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7979
	    int nBytes = b_height * bytesPerRowWN;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7980
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7981
	    if (nBytes < sizeof(fastBits)) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7982
		cp = b_bits = fastBits;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7983
	    } else {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7984
		cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7985
		if (! cp) goto fail;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7986
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7987
	}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7988
	if (cp) {
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
  7989
	    if (__isArrayLike(anArray)) {
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7990
		OBJ *op;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  7991
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7992
		index = 1;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7993
		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
  7994
		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
  7995
		    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
  7996
			num = *op++;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7997
			if (! __isSmallInteger(num))
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7998
			    goto fail;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  7999
			*cp++ = __intVal(num);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8000
		    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8001
		    cp += padding;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8002
		}
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
  8003
	    } else if (__isByteArrayLike(anArray)) {
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  8004
		unsigned char *pBits;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  8005
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8006
		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
  8007
		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
  8008
		    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
  8009
			*cp++ = ( *pBits++ /*^ 0xFF*/ );
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8010
		    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8011
		    cp += padding;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8012
		}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8013
	    } else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8014
		goto fail;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8015
	    }
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  8016
	}
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  8017
	CPRINTF(("create bitmap ...\n"));
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  8018
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  8019
	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
  8020
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  8021
	if (newBitmapHandle ) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8022
#ifdef COUNT_BMP_RESOURCES
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  8023
	    __cnt_bitmap++;
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  8024
	    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
  8025
#endif
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  8026
	    DDPRINTF(("returning bitmap %x ...\n", newBitmapHandle));
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  8027
	    if (allocatedBits) {
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  8028
		free(allocatedBits);
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  8029
	    }
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  8030
	    RETURN ( __MKOBJ(newBitmapHandle));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8031
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8032
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8033
fail: ;
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  8034
    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
  8035
    if (allocatedBits) {
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  8036
	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
  8037
	free(allocatedBits);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8038
    }
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  8039
    CPRINTF(("returning nil ...\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8040
    RETURN ( nil );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8041
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8042
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8043
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8044
primCreateWindowFor:aView type:typeSymbol
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8045
	  borderWidth:bWidth subViewOf:wsuperView
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8046
	  style:wStyle inputOnly:winputOnly
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8047
	  label:wlabel owner:wowner
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8048
	  icon:wicon iconMask:wiconMask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8049
	  moreArgs:moreArgs
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8050
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8051
%{  /* STACK: 16000 */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8052
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8053
    WNDCLASS wc;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8054
    long bg, bd, bw;
1706
ba1c3d039231 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1705
diff changeset
  8055
    int winStyleBits, winEXStyleBits;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8056
    int w, h, x, y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8057
    int min_width, min_height;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8058
    int max_width, max_height;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8059
    OBJ eventMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8060
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8061
    HANDLE parentHandle;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8062
    HWND newWindowHandle;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8063
    OBJ xpos, ypos, wwidth, wheight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8064
    OBJ minWidth, minHeight, maxWidth, maxHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8065
    OBJ wsuperViewId, wcursorId, wiconId, wiconMaskId;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8066
    OBJ wiconWidth, wiconHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8067
    OBJ windowType, windowClass, windowId;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8068
    OBJ stClassName;
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8069
    int isTopWindow = 0, isNativeWindow = 0, isMDIChild = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8070
    localWindowInfo *lI;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8071
    static createWindowInfo cwi;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8072
    static nextSequenceNr = 1;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8073
    unsigned char* cp;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8074
    HBITMAP        xBitMap, maskBitmap;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8075
    HICON          xIcon = (HICON)0;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8076
    ICONINFO       iconInfo;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8077
    char *className;
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8078
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8079
#   define MAX_LABEL_SIZE       256
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8080
#   define MAX_CLASSNAME_SIZE   256
5088
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8081
    static wchar_t classNameBufferw[MAX_CLASSNAME_SIZE];
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8082
    static wchar_t windowNameBufferw[MAX_LABEL_SIZE];
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8083
    unsigned char fastBits[10000];
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8084
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8085
    xpos = __ArrayInstPtr(moreArgs)->a_element[0];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8086
    ypos = __ArrayInstPtr(moreArgs)->a_element[1];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8087
    wwidth = __ArrayInstPtr(moreArgs)->a_element[2];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8088
    wheight = __ArrayInstPtr(moreArgs)->a_element[3];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8089
    minWidth = __ArrayInstPtr(moreArgs)->a_element[4];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8090
    minHeight = __ArrayInstPtr(moreArgs)->a_element[5];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8091
    maxWidth = __ArrayInstPtr(moreArgs)->a_element[6];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8092
    maxHeight = __ArrayInstPtr(moreArgs)->a_element[7];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8093
    wsuperViewId = __ArrayInstPtr(moreArgs)->a_element[8];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8094
    wcursorId = __ArrayInstPtr(moreArgs)->a_element[9];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8095
    wiconId = __ArrayInstPtr(moreArgs)->a_element[10];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8096
    wiconMaskId = __ArrayInstPtr(moreArgs)->a_element[11];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8097
    wiconWidth = __ArrayInstPtr(moreArgs)->a_element[12];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8098
    wiconHeight = __ArrayInstPtr(moreArgs)->a_element[13];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8099
    windowType = __ArrayInstPtr(moreArgs)->a_element[14];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8100
    windowClass = __ArrayInstPtr(moreArgs)->a_element[15];
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8101
    eventMask = __ArrayInstPtr(moreArgs)->a_element[16];
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8102
    stClassName = __ArrayInstPtr(moreArgs)->a_element[17];
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8103
    bg = WhitePixel;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8104
    bd = BlackPixel;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8105
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8106
    /* get bitmap for icon */
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8107
    if ( __isExternalAddress(wiconId) ) {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8108
	xBitMap = _HBITMAPVAL( wiconId );
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8109
	if ( xBitMap != 0 ) {
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8110
	    BITMAP bm;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8111
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8112
	    if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8113
		int d = bm.bmPlanes * bm.bmBitsPixel;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8114
		BYTE *ep;
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8115
		int height, width;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8116
		int nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8117
		unsigned char *allocatedBits = 0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8118
		int privateMask = 0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8119
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8120
		if ( __isExternalAddress(wiconMaskId) ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8121
		    maskBitmap = _HBITMAPVAL( wiconMaskId );
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8122
		} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8123
		    if (wiconMaskId != nil) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8124
			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
  8125
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8126
		    maskBitmap = 0;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8127
		}
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8128
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8129
		/*
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8130
		 * if there is no mask, generate one
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8131
		 */
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8132
		if (maskBitmap == 0) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8133
		    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
  8134
		    height = __intVal( wiconHeight );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8135
		    width  = __intVal( wiconWidth  );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8136
		    nBytes = ( width + 15 ) / 8;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8137
		    nBytes = height * nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8138
		    if (nBytes < sizeof(fastBits)) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8139
			ep = fastBits;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8140
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8141
			ep = allocatedBits = (unsigned char *) malloc(nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8142
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8143
		    if ( ep == 0 ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8144
			PRINTF(( "WinWorkstat [warning]: malloc failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8145
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8146
			memset(ep, 0, nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8147
			maskBitmap = CreateBitmap(width, height, 1, 1, ep );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8148
			if ( maskBitmap == NULL ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8149
			    PRINTF(( "WinWorkstat [warning]: mask CREATION failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8150
			} else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8151
			    privateMask = 1;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8152
			}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8153
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8154
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8155
		if ( maskBitmap != NULL ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8156
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8157
		    iconInfo.fIcon = TRUE;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8158
		    iconInfo.hbmMask  = maskBitmap;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8159
		    iconInfo.hbmColor = xBitMap;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8160
		    xIcon = CreateIconIndirect( &iconInfo );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8161
		    if (privateMask) {
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  8162
			_DeleteObject( maskBitmap, __LINE__ );
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8163
		    }
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8164
		} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8165
		    PRINTF(( "WinWorkstat [warning]: no mask for icon !\n" ));
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8166
		}
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8167
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8168
		if (allocatedBits) {
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8169
		    free(allocatedBits);
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8170
		}
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8171
	    }
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8172
	} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8173
	    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
  8174
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8175
    } else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8176
	if (wiconId != nil) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8177
	    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
  8178
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8179
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8180
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8181
    if (__bothSmallInteger(wwidth, wheight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8182
	w = __intVal(wwidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8183
	h = __intVal(wheight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8184
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8185
	w = h = 100;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8186
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8187
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8188
    if (__bothSmallInteger(xpos, ypos)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8189
	x = __intVal(xpos);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8190
	y = __intVal(ypos);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8191
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8192
	x = y = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8193
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8194
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8195
    if (__bothSmallInteger(minWidth, minHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8196
	min_width = __intVal(minWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8197
	min_height = __intVal(minHeight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8198
    } else {
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  8199
	PRINTF(("WinWorkstat [warning]: minWidth/minHeight not integer\n"))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8200
	min_width = min_height = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8201
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8202
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8203
    if (__bothSmallInteger(maxWidth, maxHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8204
	max_width = __intVal(maxWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8205
	max_height = __intVal(maxHeight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8206
    } else {
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  8207
	PRINTF(("WinWorkstat [warning]: maxWidth/maxHeight not integer\n"))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8208
	max_width = max_height = 10000;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8209
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8210
1706
ba1c3d039231 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1705
diff changeset
  8211
    winStyleBits = winEXStyleBits = 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8212
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8213
    if (__isSmallInteger(bWidth)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8214
	bw = __intVal(bWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8215
	if (bw) {
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8216
	    winStyleBits |= WS_BORDER;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8217
	    bw = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8218
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8219
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8220
	bw = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8221
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8222
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8223
    className = app_name;
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
  8224
    if (__isStringLike(windowClass)) {
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8225
	className = __stringVal(windowClass);
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  8226
	NDPRINTF(("className: %s\n", className));
5088
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8227
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8228
	if (__isInteger(wStyle)) {
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8229
	    isNativeWindow = 1;
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8230
	    winStyleBits |= __longIntVal(wStyle);
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  8231
	    NDPRINTF(("winStyleBits: %x\n", winStyleBits));
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8232
	} else {
5088
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8233
	    if (windowType != nil) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8234
		if (windowType == @symbol(RadioButton)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8235
		    isNativeWindow = 1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8236
		    winStyleBits |= BS_RADIOBUTTON;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8237
		    NDPRINTF(("class: %s - winStyleBits BS_RADIOBUTTON: %x\n", className, winStyleBits));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8238
		} else if (windowType == @symbol(CheckBox)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8239
		    isNativeWindow = 1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8240
		    winStyleBits |= BS_CHECKBOX;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8241
		    NDPRINTF(("class: %s - winStyleBits BS_CHECKBOX: %x\n", className, winStyleBits));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8242
		} else if (windowType == @symbol(HorizontalScrollBar)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8243
		    isNativeWindow = 1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8244
		    winStyleBits |= SBS_HORZ;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8245
		    NDPRINTF(("class: %s - winStyleBits SBS_HORZ: %x\n", className, winStyleBits));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8246
		} else if (windowType == @symbol(VerticalScrollBar)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8247
		    isNativeWindow = 1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8248
		    winStyleBits |= SBS_VERT;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8249
		    NDPRINTF(("class: %s - winStyleBits SBS_VERT: %x\n", className, winStyleBits));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8250
		} else if (windowType == @symbol(Button)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8251
		    isNativeWindow = 1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8252
		    NDPRINTF(("class: %s\n", className));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8253
		} else if (windowType == @symbol(OwnerDrawButton)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8254
		    isNativeWindow = 1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8255
		    winStyleBits |= BS_OWNERDRAW;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8256
		    NDPRINTF(("class: %s - winStyleBits BS_OWNERDRAW: %x\n", className, winStyleBits));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8257
		}
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8258
	    }
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8259
	}
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8260
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8261
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8262
    if (__isExternalAddress(wsuperViewId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8263
	/*
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8264
	 * a child window
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8265
	 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8266
	parentHandle = _HANDLEVal(wsuperViewId);
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8267
	if (wStyle == @symbol(mdiChild)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8268
	    isMDIChild = 1;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8269
	}
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8270
    } else {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8271
	parentHandle = NULL;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8272
	isTopWindow = 1;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8273
    }
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8274
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8275
    if (!isTopWindow && !isMDIChild) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8276
	/*
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8277
	 * a child window
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8278
	 */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8279
	winStyleBits |= WS_CHILD;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8280
	if (winputOnly != true) {
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8281
	    winStyleBits |= (WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8282
	    /*winStyleBits |= WS_CLIPCHILDREN;*/
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8283
	    DPRINTF(("parent handle=%x\n", parentHandle));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8284
	} else {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8285
	    winEXStyleBits |= WS_EX_TRANSPARENT;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8286
	    DPRINTF(("inputview parent handle=%x\n", parentHandle));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8287
	}
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8288
#if 0
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8289
	winEXStyleBits |= WS_EX_NOPARENTNOTIFY;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8290
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8291
    } else {
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  8292
	/*
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8293
	 * a top window (regular / popUp / dialog) or MDIChild
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  8294
	 */
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8295
	if (isMDIChild) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8296
	    winEXStyleBits |= WS_EX_MDICHILD;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8297
	}
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8298
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8299
	if (! isMDIChild)
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8300
	{
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  8301
#ifdef TOPWINDOWCLASS
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8302
	    this could fail, since a pointer to local buf is passed
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8303
	    to the window-creation code (in the other thread ...)
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8304
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8305
	    static winCount = 1;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8306
	    char buf[300];
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8307
	    char *stName;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8308
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8309
# ifdef __BORLANDC__
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8310
	    struct timeb timebuffer;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8311
	    ftime(&timebuffer);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8312
# else
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8313
	    struct _timeb timebuffer;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8314
	    _ftime(&timebuffer);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8315
# endif
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8316
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
  8317
	    if (__isStringLike(stClassName)) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8318
		stName = __stringVal(stClassName);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8319
	    } else {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8320
		stName = app_name;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8321
	    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8322
	    sprintf(buf, "S%d.%d%s", HIWORD(timebuffer.time), ++winCount, stName);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8323
	    DPRINTF(("topview - registerClass:%s\n",buf));
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8324
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8325
	    wc.style = /* CS_HREDRAW | CS_VREDRAW | CS_OWNDC  |*/ CS_DBLCLKS;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8326
	    wc.lpfnWndProc = (WNDPROC) MainWndProc;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8327
	    wc.cbClsExtra = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8328
	    wc.cbWndExtra = N_WINDOW_PRIVATE;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8329
	    wc.hInstance = (HANDLE) __getHInstance();
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8330
	    if (xIcon) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8331
		wc.hIcon   = xIcon;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8332
		/* 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
  8333
	    } else {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8334
		wc.hIcon = NULL;        /* THIS MUST BE NULL TO DELETE ICONS */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8335
	    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8336
	    wc.hCursor = 0 /* LoadCursor(NULL, IDC_ARROW) */;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8337
	    wc.hbrBackground = 0; /*CreateSolidBrush (bg);*/
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8338
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8339
	    wc.lpszMenuName =  NULL;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8340
	    wc.lpszClassName = buf;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8341
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8342
	    if (!RegisterClass(&wc)) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8343
		PRINTF(("RegisterClass failed\n"));
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8344
		RETURN( nil );
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8345
	    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8346
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8347
	    className = buf;
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8348
#endif /* TOPWINDOWCLASS */
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8349
	}
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8350
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8351
	if (wStyle == @symbol(popUp)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8352
	    winStyleBits |= WS_POPUP;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8353
	    winStyleBits |= WS_DISABLED;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8354
	    winEXStyleBits |= WS_EX_TOOLWINDOW;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8355
	    CPRINTF(("Create popUpWindow\n"));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8356
#if 0
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8357
	    parentHandle = GetActiveWindow();
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8358
#endif
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8359
4257
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8360
	} else if ((wStyle == @symbol(dialog)) || (wStyle == @symbol(toolDialog))) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8361
	    winStyleBits |= WS_OVERLAPPED | WS_CAPTION | DS_MODALFRAME | WS_SYSMENU | WS_SIZEBOX;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  8362
	    winStyleBits |= WS_POPUP;
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  8363
	    winStyleBits |= DS_NOIDLEMSG;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  8364
	    //winEXStyleBits |= WS_EX_TOOLWINDOW;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8365
	    if ((min_width || min_height)
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8366
	     && (min_width == max_width)
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8367
	     && (min_height == max_height)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8368
		winStyleBits &= ~WS_THICKFRAME;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8369
	    }
4257
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8370
	    if (wStyle == @symbol(toolDialog)) {
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8371
		winEXStyleBits |= WS_EX_TOOLWINDOW;
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8372
	    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8373
	} else if (wStyle == @symbol(undecorated)) {
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8374
	    winStyleBits |= WS_OVERLAPPED;
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8375
	    winEXStyleBits |= WS_EX_WINDOWEDGE;
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8376
	} else if (isMDIChild) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8377
	    winStyleBits |= WS_OVERLAPPED | WS_CAPTION | DS_MODALFRAME | WS_SYSMENU | WS_SIZEBOX;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8378
	    if ((min_width || min_height)
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8379
	     && (min_width == max_width)
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8380
	     && (min_height == max_height)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8381
		winStyleBits &= ~WS_THICKFRAME;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8382
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8383
	} else {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  8384
	    //winStyleBits |= WS_OVERLAPPEDWINDOW;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8385
	    winStyleBits |= WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_SIZEBOX;
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  8386
	    //winEXStyleBits |= WS_EX_CLIENTEDGE;
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  8387
	    winEXStyleBits |= WS_EX_WINDOWEDGE;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  8388
	    //winEXStyleBits |= WS_EX_ACCEPTFILES;
4257
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8389
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8390
	    if (wStyle == @symbol(toolWindow)) {
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8391
		winEXStyleBits |= WS_EX_TOOLWINDOW;
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8392
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8393
	}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8394
	winStyleBits |= WS_CLIPCHILDREN;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8395
    }
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8396
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8397
    rec.left = x;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8398
    rec.top = y;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8399
    rec.right = x + w;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8400
    rec.bottom = y+ h;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8401
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8402
    /* use static memory for the createwindowInfo;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8403
     * 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
  8404
     * 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
  8405
     * when in a sizeMove-loop.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8406
     * (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
  8407
     *  early via the pending- mechanism)
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8408
     * 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
  8409
     * is passed with the message and also stored in the cwi.
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8410
     * If this sequence number differs, we got a late message.
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8411
     */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8412
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8413
    /*
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8414
     * check if previous request has been properly processed ...
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8415
     */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8416
    if (cwi.sequenceNr && (cwi.sequenceNr != INVALIDATED_CWI)) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8417
	console_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
  8418
	/* this prevents the event processor from interpreting this message */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8419
	cwi.sequenceNr = nextSequenceNr;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8420
    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8421
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8422
    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
  8423
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8424
#ifdef ADJUSTWINDOW
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8425
    AdjustWindowRectEx(&rec, winStyleBits, 0, cwi.winStyleBitsEx);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8426
    w = rec.right - rec.left;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8427
    h = rec.bottom - rec.top;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8428
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8429
4265
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  8430
    DPRINTF(("create%s pos==%d/%d size=%d/%d bw:%d parent:%x class:'%s' style:%x exStyle:%x ...\n",
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  8431
		((wStyle == @symbol(popUp)) ? " popUp" : ""),
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  8432
		x, y, w, h,
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  8433
		bw, parentHandle, className,
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  8434
		winStyleBits, winEXStyleBits));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8435
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8436
    /* allocate localMemory for Window */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8437
    lI = (localWindowInfo *) malloc(sizeof(localWindowInfo));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8438
    if (! lI) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8439
	console_fprintf(stderr, "WinWorkstation [error]: malloc failed in CreateWindow\n");
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8440
	RETURN ( nil );
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8441
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8442
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8443
    memset(lI, 0, sizeof(localWindowInfo));
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  8444
    lI->mouseX = lI->mouseY = -9999;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  8445
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8446
    if (isTopWindow) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8447
	if (rec.left < 0) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8448
	    rec.left = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8449
	    rec.right = w;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8450
	}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8451
	if (rec.top < 0) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8452
	    rec.top = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8453
	    rec.bottom = h;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8454
	}
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8455
	lI->flag |= LI_TOPWIN;
2462
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  8456
    } else {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8457
	if (bw) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8458
	    // adjust for border
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8459
	    rec.left++;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8460
	    rec.top++;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8461
	}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8462
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8463
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  8464
    if (winputOnly == true) {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8465
	lI->flag |= LI_INPUTWIN;
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  8466
    }
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8467
    if (isNativeWindow) {
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  8468
	NDPRINTF(("set native flag\n"));
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8469
	lI->flag |= LI_NATIVEWIN;
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8470
    }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8471
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8472
    if (wStyle == @symbol(popUp)) {
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8473
	cwi.className = wapp_namePopup;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8474
    } else {
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8475
	if (wStyle == @symbol(dialog)) {
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8476
	    cwi.className = wapp_nameDialog;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8477
	} else {
5088
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8478
	    ch2wch(className, classNameBufferw, MAX_CLASSNAME_SIZE);
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8479
	    cwi.className = classNameBufferw;
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8480
	}
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8481
    }
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  8482
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8483
    cwi.winStyleBits = winStyleBits;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8484
    cwi.parentHandle = parentHandle;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8485
    cwi.x = rec.left;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8486
    cwi.y = rec.top;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8487
    cwi.dx = rec.right - rec.left;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8488
    cwi.dy = rec.bottom - rec.top;
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8489
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8490
    if (isTopWindow | isMDIChild) {
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8491
	rec.left = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8492
	rec.top = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8493
	rec.right = min_width;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8494
	rec.bottom = min_height;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8495
#ifdef ADJUSTWINDOW
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8496
	AdjustWindowRectEx(&rec, winStyleBits, 0, cwi.winStyleBitsEx);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8497
#endif
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8498
	lI->minWidth = rec.right - rec.left;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8499
	lI->minHeight = rec.bottom - rec.top;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8500
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8501
	rec.left = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8502
	rec.top = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8503
	rec.right = max_width;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8504
	rec.bottom = max_height;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8505
#ifdef ADJUSTWINDOW
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8506
	AdjustWindowRectEx(&rec, winStyleBits, 0, cwi.winStyleBitsEx);
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8507
#endif
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8508
	lI->maxWidth = rec.right - rec.left;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8509
	lI->maxHeight = rec.bottom - rec.top;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8510
    } else {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8511
	lI->minWidth = lI->minHeight = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8512
	lI->maxWidth = lI->maxHeight = 9999;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8513
    }
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  8514
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  8515
    lI->viewBgBrush = __whiteBrush;
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  8516
    lI->viewBgColor = WhitePixel;
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  8517
    lI->bdColor = BlackPixel;
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  8518
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8519
    if (__isSmallInteger(eventMask))
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8520
	lI->eventMask = __intVal(eventMask);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8521
    else
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8522
	lI->eventMask = 0xffffffff;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8523
    DPRINTF(("eventMask is %x\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8524
#ifdef DEBUGMASK1
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8525
    printMask(lI->eventMask);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8526
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8527
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8528
    lI->bw = bw;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8529
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8530
    cwi.newWinHandle = newWindowHandle = NULL;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8531
    cwi.windowName = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8532
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8533
    if (isTopWindow | isMDIChild) {
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
  8534
	if (__isStringLike(wlabel)) {
5088
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8535
	    ch2wch((char *)__stringVal(wlabel), windowNameBufferw, MAX_LABEL_SIZE);
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8536
	    cwi.windowName = windowNameBufferw;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8537
	} else
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8538
	    if (__isUnicode16String(wlabel)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8539
		int l = __unicode16StringSize(wlabel);
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8540
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8541
		if (l >= MAX_LABEL_SIZE) l = MAX_LABEL_SIZE-1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8542
		memmove(windowNameBufferw, __unicode16StringVal(wlabel), l*sizeof(wchar_t));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8543
		windowNameBufferw[ l ] = 0;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8544
		cwi.windowName = windowNameBufferw;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8545
	    }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8546
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8547
2665
4b88034ccb36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2664
diff changeset
  8548
    cwi.infoWasRead = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8549
    cwi.localWindowInfo = lI;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8550
    cwi.sequenceNr = nextSequenceNr;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8551
    nextSequenceNr = (nextSequenceNr + 1) & 0x7FFF;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8552
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8553
#ifndef NEW_CREATE_EVENT
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8554
    cwi.hCreateEvent = hCreateEvent;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8555
    ResetEvent(cwi.hCreateEvent);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8556
#else
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8557
    /* creating a new event does not work - why ? */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8558
    cwi.hCreateEvent = CreateEvent(
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8559
	NULL,        /* no security attributes */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8560
	FALSE,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8561
	FALSE,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8562
	NULL);       /* name of mutex */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8563
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8564
    if (cwi.hCreateEvent == NULL) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8565
	console_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
  8566
	cwi.sequenceNr = INVALIDATED_CWI;
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  8567
	free(lI);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8568
	RETURN ( nil );
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8569
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8570
#endif
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8571
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8572
    /*
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8573
     * kludge to allow for createWindow while in sizeMove processing loop
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8574
     */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8575
    if (pendingCREATEWINDOWInfo) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8576
	console_fprintf(stderr, "WinWorkstation [error]: oops - pending create\n");
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8577
    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8578
    pendingCREATEWINDOWInfo = &cwi;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8579
    pendingSequenceNr = cwi.sequenceNr;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8580
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8581
    if (PostThreadMessage(_dispatchThreadId, WM_THREAD_CREATEWINDOW, cwi.sequenceNr, (INT)(&cwi)) == FALSE) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8582
	console_fprintf(stderr, "WinWorkstation [error]: oops - PostThreadMessage(%x) failed in CreateWindow: err=%d\n",
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  8583
					_dispatchThreadId, GetLastError() );
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8584
	free(lI);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8585
	RETURN (nil);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8586
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8587
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8588
    if (cwi.newWinHandle != NULL) {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8589
	cwi.sequenceNr = INVALIDATED_CWI;
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  8590
	cwi.hCreateEvent = NULL;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8591
	/* wow - that was quick ... */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8592
    } else {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8593
	DWORD dwWaitResult;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8594
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8595
	/* wait for the window to be created ... */
4504
0f0a6f7fabd5 lockEvent bug (workaround ?)
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  8596
	dwWaitResult = WaitForSingleObject(hCreateEvent, 5000L);
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8597
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8598
	/* no longer want to get informed ... */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8599
	cwi.hCreateEvent = NULL;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8600
	cwi.sequenceNr = INVALIDATED_CWI;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8601
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8602
	switch (dwWaitResult) {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8603
	    // The thread got mutex ownership.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8604
	    case WAIT_OBJECT_0:
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8605
		break;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8606
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8607
	    // Cannot get mutex ownership due to time-out.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8608
	    case WAIT_TIMEOUT:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8609
		DEBUGFPRINTF((stderr, "WinWorkstation [error]: oops - timeout in CreateWindow\n"));
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8610
		break;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8611
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8612
	    // Got ownership of the abandoned mutex object.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8613
	    default:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8614
		DEBUGFPRINTF((stderr, "WinWorkstation [warning]: CreateEvent abandoned\n"));
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8615
		break;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8616
	}
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8618
#ifdef NEW_CREATE_EVENT
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8619
	CloseHandle(cwi.hCreateEvent);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8620
#endif
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8621
    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8622
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8623
    pendingCREATEWINDOWInfo = 0;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8624
    newWindowHandle = cwi.newWinHandle;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8625
    DPRINTF(("handle = %x\n", newWindowHandle));
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8626
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8627
    if (! newWindowHandle) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8628
	console_fprintf(stderr, "WinWorkstation [error]: CreateWindow failed: %d (0x%x) [%d]\n",
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8629
			cwi.errCode, cwi.errCode, __LINE__ );
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  8630
	if (cwi.infoWasRead) {
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  8631
	    free(lI);
4284
5efcb512f038 *** empty log message ***
ca
parents: 4281
diff changeset
  8632
	} else {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8633
	    console_fprintf(stderr, "WinWorkstation [warning]: localInfo memory leak [%d]\n", __LINE__ );
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  8634
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8635
	RETURN ( nil );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8636
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8637
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8638
#ifdef CACHE_LAST_DC
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8639
    if (lastGcData && (lastGcHWIN == newWindowHandle)) {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8640
	_releaseDC(lastGcData);
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8641
    }
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8642
#endif
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8643
#ifdef CACHE_LAST_WM_PAINT_DC
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8644
    if (last_wm_paint_dc && (last_wm_paint_win == newWindowHandle)) {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8645
	ReleaseDC(newWindowHandle, last_wm_paint_dc);
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8646
	last_wm_paint_win = last_wm_paint_dc = 0;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8647
    }
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8648
#endif
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8649
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8650
    windowId = __MKOBJ(newWindowHandle);
4368
f8d0e4be74eb raising windows
penk
parents: 4367
diff changeset
  8651
#if 1
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8652
    if (isTopWindow | isMDIChild) {
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8653
	/*
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8654
	 * mhmh - what is that raise for ?
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8655
	 */
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8656
	SetWindowPos(newWindowHandle, HWND_TOP, 0, 0, 0, 0,
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8657
		     SWP_NOSENDCHANGING |
4368
f8d0e4be74eb raising windows
penk
parents: 4367
diff changeset
  8658
		     /* SWP_NOACTIVATE | */ SWP_NOMOVE | SWP_NOSIZE);
f8d0e4be74eb raising windows
penk
parents: 4367
diff changeset
  8659
    } else {
f8d0e4be74eb raising windows
penk
parents: 4367
diff changeset
  8660
	SetWindowPos(newWindowHandle, HWND_TOP, 0, 0, 0, 0,
f8d0e4be74eb raising windows
penk
parents: 4367
diff changeset
  8661
		     SWP_NOSENDCHANGING |
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8662
		     SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8663
    }
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8664
#endif
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8665
    if (isTopWindow | isMDIChild) {
2697
0fbd675cf5b2 update region processing
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
  8666
	BringWindowToTop(newWindowHandle);
0fbd675cf5b2 update region processing
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
  8667
    }
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  8668
    DragAcceptFiles(newWindowHandle, 1);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8669
4240
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
  8670
    if (isNativeWindow) {
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
  8671
	if (winStyleBits & (SBS_HORZ | SBS_VERT)) {
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
  8672
	    SetScrollRange(newWindowHandle, SB_CTL, 0, 100, 0);
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
  8673
	    SetScrollPos(newWindowHandle, SB_CTL, 0, 0);
4240
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
  8674
	}
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
  8675
    }
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
  8676
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  8677
#ifndef TOPWINDOWCLASS
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8678
    if (xIcon) {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8679
	SendMessage(newWindowHandle, WM_SETICON, ICON_SMALL, (LPARAM)xIcon);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8680
	SendMessage(newWindowHandle, WM_SETICON, ICON_BIG, (LPARAM)xIcon);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8681
    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8682
#endif
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8683
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8684
    DPRINTF(("done - create\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8685
    RETURN (windowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8686
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8687
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8688
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8689
primDestroyView:aView withId:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8690
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8691
%{  /* NOCONTEXT */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8692
    HICON oldIcon;
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8693
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8694
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8695
	HWND win = _HWNDVal(aWindowId);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8696
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8697
	if (win && IsWindow(win)) {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  8698
#ifndef TOPWINDOWCLASS
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  8699
	    oldIcon = (HICON) GetClassLong(win, GCL_HICON);
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  8700
	    SetClassLong(win, GCL_HICON, (DWORD)0);
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  8701
	    /* 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
  8702
	    if ( oldIcon ) {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8703
		if ( DestroyIcon( oldIcon )) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8704
		    DPRINTF(( "Old icon deleted\n" ));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8705
		} else {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8706
		    console_fprintf(stderr, "failed to destroy icon\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8707
		}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8708
	    }
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8709
#endif
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8710
	   /*console_printf("post WM_THREAD_DESTROYWINDOW\n");*/
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  8711
	    PostMessage(win, WM_THREAD_DESTROYWINDOW, 0, 0);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8712
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8713
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8714
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8715
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8716
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8717
rootWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8718
    "return the id of the root window.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8719
     This is the window you see as background,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8720
     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
  8721
     since some window managers install a virtual root window on top
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8722
     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
  8723
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8724
    ^ rootWin
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8725
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8726
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8727
!WinWorkstation methodsFor:'clipboard'!
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8728
4748
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8729
getClipboardObjectFor:drawableId
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8730
    "answer an arbitrary object from the clipboard, or nil,
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8731
     if there is no data that we are able to handle (decode)"
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8732
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8733
    |currentSequenceNumber|
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8734
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8735
    currentSequenceNumber := self getClipboardSequenceNumber.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8736
    lastClipboardSequenceNumber ~= currentSequenceNumber ifTrue:[
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8737
	"copyBuffer is invalid, fill it from the windows clipboard.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8738
	 Even if we could not decode the windows clipboard,
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8739
	 we intentionally set the copyBuffer to nil to get a consistent
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8740
	 behavior."
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8741
	copyBuffer := self getClipboardData.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8742
	lastClipboardSequenceNumber := currentSequenceNumber.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8743
    ].
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8744
    ^ copyBuffer
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8745
!
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8746
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8747
getClipboardText:selectionBufferSymbol for:drawableId
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8748
     "get the contents of the clipboard and answer a String,
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8749
      or nil, if there is no data that we can handle (decode)."
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8750
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8751
    |currentSequenceNumber|
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8752
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8753
    currentSequenceNumber := self getClipboardSequenceNumber.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8754
    lastClipboardSequenceNumber ~= currentSequenceNumber ifTrue:[
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8755
	"copyBuffer is invalid, fill it from the windows clipboard.
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8756
	 Even if we could not decode the windows clipboard,
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8757
	 we intentionally set the copyBuffer to nil to get a consistent
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8758
	 behavior."
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8759
	copyBuffer := self getClipboardData.
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8760
	lastClipboardSequenceNumber := currentSequenceNumber.
4748
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8761
    ].
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8762
    ^ self copyBufferAsString
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8763
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8764
    "
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8765
     Screen current getClipboardText:#clipboard for:nil
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8766
    "
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8767
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8768
    "Modified: / 09-10-2007 / 12:42:08 / cg"
4748
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8769
!
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8770
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8771
setClipboardObject:something owner:drawableId
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8772
    "store an arbitrary object into the clipboard.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8773
     Since we currently support only text, any other object
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8774
     is stored only in our local copyBuffer and not made available
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8775
     to other applications."
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8776
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8777
    something isString ifTrue:[
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8778
	self setClipboardText:something owner:drawableId.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8779
	^ self
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8780
    ].
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8781
    something isStringCollection ifTrue:[
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8782
	self setClipboardText:something asString owner:drawableId.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8783
	^ self
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8784
    ].
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8785
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8786
    "copyBuffer is valid until the clipboard sequence number increases,
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8787
     because new data has been put into the clipboard"
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8788
    lastClipboardSequenceNumber := self getClipboardSequenceNumber.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8789
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8790
    "Created: / 13.7.1999 / 13:30:37 / cg"
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8791
    "Modified: / 30.1.2000 / 11:59:41 / cg"
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8792
!
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8793
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8794
setClipboardText:something owner:drawableId
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8795
    "store some text into the clipboard"
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8796
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8797
    |result|
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8798
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8799
    result := self setClipboardData:something asString string.  "take care of StringCollections"
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8800
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8801
    "as long as the sequence number doesn't change, our copyBuffer is valid"
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8802
    lastClipboardSequenceNumber := self getClipboardSequenceNumber.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8803
    ^ result.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8804
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8805
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8806
    "Created: / 13.7.1999 / 13:36:43 / cg"
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8807
    "Modified: / 30.1.2000 / 12:12:57 / cg"
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8808
! !
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8809
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8810
!WinWorkstation methodsFor:'clipboard-private'!
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8811
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8812
getClipboardData
4748
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8813
    "get the contents of the windows clipboard.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8814
     Answer a string on success or nil otherwise.
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8815
     Caveat: for now, only Text and UnicodeText are supported"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8816
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8817
    |data|
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8818
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8819
    (data := self getUnicodeClipboardData) notNil ifTrue:[^ data].
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8820
    (data := self getTextClipboardData) notNil ifTrue:[^ data].
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8821
    ^ nil
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8822
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8823
    "Modified: / 09-10-2007 / 12:47:02 / cg"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8824
!
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8825
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8826
getClipboardDataBytes:format
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8827
    "get the contents of the windows clipboard as raw bytes.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8828
     Answer an image on success or nil otherwise."
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8829
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8830
    |bytes|
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8831
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8832
%{
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8833
    HANDLE hClip;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8834
    HANDLE hData;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8835
    unsigned char *src, *p;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8836
    WIDECHAR *w_src, *w_p;
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8837
    int fmt;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8838
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8839
    if (format == @symbol(CF_TIFF)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8840
	fmt = CF_TIFF;
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8841
    } else if (format == @symbol(CF_BITMAP)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8842
	fmt = CF_BITMAP;
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8843
    } else if (format == @symbol(CF_DIB)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8844
	fmt = CF_DIB;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8845
    } else
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8846
	goto badFormat;
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8847
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8848
    if (IsClipboardFormatAvailable(fmt)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8849
	int len;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8850
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8851
	hClip = OpenClipboard(NULL);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8852
	if (hClip) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8853
	    hData = GetClipboardData(fmt);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8854
	    if (hData) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8855
		len = GlobalSize(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8856
		src = GlobalLock(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8857
		if (src) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8858
		    bytes = __MKBYTEARRAY(src, len);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8859
		}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8860
		GlobalUnlock(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8861
		CloseClipboard();
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8862
		DDPRINTF((stderr, "WinWorkstation [info]: clipBoard data size is <%d>\n", len));
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8863
		RETURN(bytes);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8864
	    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8865
	}
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8866
    }
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8867
badFormat: ;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8868
%}.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8869
    ^ nil
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8870
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8871
    "
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8872
     Screen current getClipboardDataBytes:#CF_TIFF
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8873
     Screen current getClipboardDataBytes:#CF_BITMAP
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8874
     Screen current getClipboardDataBytes:#CF_DIB
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8875
    "
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8876
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8877
    "Created: / 09-10-2007 / 13:11:12 / cg"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8878
    "Modified: / 09-10-2007 / 14:18:26 / cg"
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8879
!
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8880
4748
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8881
getClipboardOwner
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8882
    "answer an handle telling us, who owns the clipboard."
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8883
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8884
%{
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8885
    HANDLE hWnd;
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8886
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8887
    hWnd = GetClipboardOwner();
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8888
    RETURN(__MKEXTERNALADDRESS(hWnd));
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8889
%}
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8890
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8891
   "
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8892
	Screen current getClipboardOwner
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8893
   "
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8894
!
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8895
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8896
getClipboardSequenceNumber
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8897
    "answer the sequence number of the clioboard.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8898
     Each time, the keyboard is changed, the sequence number is incremented."
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8899
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8900
%{
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8901
    DWORD sequenceNumber;
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8902
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8903
    sequenceNumber = GetClipboardSequenceNumber();
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8904
    RETURN(__MKUINT(sequenceNumber));
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8905
%}
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8906
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8907
   "
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8908
	Screen current getClipboardSequenceNumber
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8909
   "
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8910
!
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8911
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8912
getImapeClipboardData
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8913
    "get the contents of the windows clipboard.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8914
     Answer an image on success or nil otherwise."
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8915
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8916
    |data|
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8917
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8918
    (data := self getClipboardDataBytes:#CF_TIFF) notNil ifTrue:[
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8919
	"/ tiff image in data...
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8920
	^ "TIFFReader fromBytes:data" nil
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8921
    ].
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8922
    (data := self getClipboardDataBytes:#CF_DIB) notNil ifTrue:[
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8923
	"/ device independent bitmap image in data...
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8924
	^ "TIFFReader fromBytes:data" nil
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8925
    ].
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8926
    ^ nil
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8927
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8928
    "Created: / 09-10-2007 / 14:19:53 / cg"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8929
!
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8930
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8931
getTextClipboardData
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8932
    "get the contents of the windows clipboard.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8933
     Answer a string on success or nil otherwise.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8934
     Caveat: for now, only Text is supported"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8935
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8936
%{
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8937
    HANDLE hClip;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8938
    HANDLE hData;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8939
    OBJ s;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8940
    unsigned char *src, *p;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8941
    WIDECHAR *w_src, *w_p;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8942
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8943
    /* check for format CF_TEXT */
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8944
    if (IsClipboardFormatAvailable(CF_TEXT)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8945
	int nRemain, len, realLen;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8946
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8947
	hClip = OpenClipboard(NULL);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8948
	if (hClip) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8949
	    hData = GetClipboardData(CF_TEXT);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8950
	    src = GlobalLock(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8951
	    len = src ? strlen(src) : 0;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8952
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8953
	    /* see how much we really need (when CRLF is replaced by LF) */
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8954
	    for (realLen=nRemain=len, p=src; nRemain; ) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8955
		unsigned char ch;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8956
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8957
		ch = *p++; nRemain--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8958
		if (ch == 0x0D) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8959
		    if (nRemain && (*p == 0x0A)) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8960
			p++; nRemain--;realLen--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8961
		    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8962
		}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8963
	    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8964
	    s = __MKEMPTYSTRING(realLen);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8965
	    if (s != nil) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8966
		for (p=__stringVal(s); len; ) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8967
		    unsigned char ch;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8968
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8969
		    *p = ch = *src++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8970
		    len--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8971
		    if (len && (ch == 0x0D) && (*src == 0x0A)) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8972
			*p = 0x0A;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8973
			src++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8974
			len--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8975
		    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8976
		    p++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8977
		}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8978
	    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8979
	    GlobalUnlock(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8980
	    CloseClipboard();
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8981
	    DDPRINTF((stderr, "WinWorkstation [info]: clipBoard data is <%s>\n", (char *)hData));
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8982
	    RETURN(s);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8983
	}
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8984
    }
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8985
%}.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8986
    ^ nil
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8987
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8988
    "Created: / 09-10-2007 / 12:46:00 / cg"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8989
!
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8990
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8991
getUnicodeClipboardData
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8992
    "get the contents of the windows clipboard.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8993
     Answer a string on success or nil otherwise.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8994
     Caveat: for now, only Text is supported"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8995
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8996
%{
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8997
    HANDLE hClip;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8998
    HANDLE hData;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8999
    OBJ s;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9000
    unsigned char *src, *p;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9001
    WIDECHAR *w_src, *w_p;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9002
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9003
    /* Unicode */
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9004
    if (IsClipboardFormatAvailable(CF_UNICODETEXT)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9005
	int nRemain, len, realLen;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9006
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9007
	hClip = OpenClipboard(NULL);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9008
	if (hClip) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9009
	    int needUnicode = 0;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9010
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9011
	    hData = GetClipboardData(CF_UNICODETEXT);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9012
	    w_src = GlobalLock(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9013
	    len = w_src ? wcslen(w_src) : 0;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9014
	    /*
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9015
	     * see how much we really need (when CRLF is replaced by LF)
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9016
	     * and if result is really Unicode ...
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9017
	     */
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9018
	    for (realLen=nRemain=len, w_p=w_src; nRemain; ) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9019
		WIDECHAR w_ch;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9020
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9021
		w_ch = *w_p++; nRemain--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9022
		if ((unsigned) w_ch > 0xFF) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9023
		    needUnicode = 1;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9024
		}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9025
		if (w_ch == 0x0D) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9026
		    if (nRemain && (*w_p == 0x0A)) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9027
			w_p++; nRemain--;realLen--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9028
		    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9029
		}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9030
	    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9031
	    if (! needUnicode) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9032
		s = __MKEMPTYSTRING(realLen);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9033
		if (s != nil) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9034
		    for (p = __stringVal(s); len; ) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9035
			unsigned char ch;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9036
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9037
			*p = ch = *w_src++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9038
			len--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9039
			if (len && (ch == 0x0D) && (*w_src == 0x0A)) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9040
			    *p = 0x0A;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9041
			    w_src++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9042
			    len--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9043
			}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9044
			p++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9045
		    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9046
		}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9047
	    } else {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9048
		s = __BYTEARRAY_NEW_INT(realLen * 2);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9049
		if (s != nil) {
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
  9050
		    __qClass(s) = @global(Unicode16String);
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9051
		    for (w_p = (WIDECHAR *)__stringVal(s); len; ) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9052
			WIDECHAR w_ch;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9053
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9054
			*w_p = w_ch = *w_src++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9055
			len--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9056
			if (len && (w_ch == 0x0D) && (*w_src == 0x0A)) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9057
			    *w_p = 0x0A;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9058
			    w_src++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9059
			    len--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9060
			}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9061
			w_p++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9062
		    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9063
		}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9064
	    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9065
	    GlobalUnlock(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9066
	    CloseClipboard();
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9067
	    RETURN(s);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9068
	}
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9069
    }
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9070
%}.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9071
    ^ nil
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9072
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9073
    "Created: / 09-10-2007 / 12:45:26 / cg"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9074
!
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9075
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9076
setClipboardData:aString
4748
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9077
    "Set the contents of the windows clipboard.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9078
     Answer true, if the operation succeeded, false otherwise.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9079
     Caveat: for now, only Text is supported."
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9080
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9081
%{
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9082
    HANDLE hClip;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9083
    HANDLE hData;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9084
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
  9085
    if (__isStringLike(aString)) {
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9086
	char *s, *p, *src, *dst;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9087
	int n, len, realLen;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9088
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9089
	hClip = OpenClipboard(NULL);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9090
	if (hClip) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9091
	    s = __stringVal(aString);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9092
	    /* must replace CR by CRLF */
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9093
	    len = realLen = __stringSize(aString);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9094
	    for (src=s, n=len; n; n--) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9095
		if ((src[0] == 0x0A) && ((src == s) || (src[-1] != 0x0D))) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9096
		    realLen++;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9097
		}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9098
		src++;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9099
	    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9100
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9101
	    hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, realLen+1);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9102
	    if (hData) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9103
		char *t = GlobalLock(hData);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9104
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9105
		if (t) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9106
		    for (src=s, dst=t, n=len; n;) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9107
			unsigned char ch;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9108
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9109
			ch = src[0]; n--;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9110
			if ((ch == 0x0A) && ((src == s) || (src[-1] != 0x0D))) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9111
			    *dst++ = 0x0D;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9112
			    *dst++ = 0x0A;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9113
			} else {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9114
			    *dst++ = ch;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9115
			}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9116
			src++;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9117
		    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9118
		    *dst = 0;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9119
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9120
		    EmptyClipboard();
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9121
		    if (SetClipboardData(CF_TEXT, hData) != 0) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9122
			/* Note: After setting clipboard data,
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9123
			 * the memory block previously allocated belongs to
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9124
			 * the clipboard - not to the app.
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9125
			 */
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9126
			CloseClipboard();
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9127
			RETURN (true);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9128
		    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9129
		    DPRINTF(("SetClipboardData error:%d\n", GetLastError()));
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9130
		    GlobalUnlock(hData);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9131
		}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9132
	    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9133
	    CloseClipboard();
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9134
	}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9135
	RETURN(false);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9136
    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9137
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9138
    /* Unicode */
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9139
    if (__isWords(aString)) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9140
	WIDECHAR *w_s, *w_p, *w_src, *w_dst;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9141
	int n, len, realLen;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9142
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9143
	hClip = OpenClipboard(NULL);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9144
	if (hClip) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9145
	    OBJ cls;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9146
	    int nInstBytes;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9147
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9148
	    cls = __qClass(aString);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9149
	    nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9150
	    w_s = (WIDECHAR *)(__stringVal(aString) + nInstBytes);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9151
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9152
	    /* must replace CR by CRLF */
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9153
	    len = realLen = (__byteArraySize(aString) - nInstBytes) / 2;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9154
	    for (w_src=w_s, n=len; n; n--) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9155
		if ((w_src[0] == 0x0A) && ((w_src == w_s) || (w_src[-1] != 0x0D))) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9156
		    realLen++;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9157
		}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9158
		w_src++;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9159
	    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9160
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9161
	    hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, (realLen+1)*sizeof(WIDECHAR));
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9162
	    if (hData) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9163
		char *t = GlobalLock(hData);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9164
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9165
		if (t) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9166
		    for (w_src=w_s, w_dst=t, n=len; n;) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9167
			WIDECHAR w_ch;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9168
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9169
			w_ch = w_src[0]; n--;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9170
			if ((w_ch == 0x0A) && ((w_src == w_s) || (w_src[-1] != 0x0D))) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9171
			    *w_dst++ = 0x0D;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9172
			    *w_dst++ = 0x0A;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9173
			} else {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9174
			    *w_dst++ = w_ch;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9175
			}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9176
			w_src++;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9177
		    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9178
		    *w_dst = 0;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9179
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9180
		    EmptyClipboard();
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9181
		    if (SetClipboardData(CF_UNICODETEXT, hData) != 0) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9182
			/* Note: After setting clipboard data,
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9183
			 * the memory block previously allocated belongs to
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9184
			 * the clipboard - not to the app.
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9185
			 */
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9186
			CloseClipboard();
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9187
			RETURN (true);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9188
		    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9189
		    DPRINTF(("SetClipboardData error:%d\n", GetLastError()));
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9190
		    GlobalUnlock(hData);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9191
		}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9192
	    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9193
	    CloseClipboard();
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9194
	}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9195
	RETURN(false);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9196
    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9197
%}.
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9198
    self primitiveFailed.
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9199
! !
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9200
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9201
!WinWorkstation methodsFor:'color stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9202
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9203
colorRed:redVal green:greenVal blue:blueVal
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9204
    "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
  9205
     This method is obsoleted by #colorScaledRed:scaledGreen:scaledBlue:"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9206
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9207
    |r g b|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9208
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9209
    r := self percentToDeviceColorValue:redVal.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9210
    g := self percentToDeviceColorValue:greenVal.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9211
    b := self percentToDeviceColorValue:blueVal.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9212
    ^ self colorScaledRed:r scaledGreen:g scaledBlue:b
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9213
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9214
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9215
colorScaledRed:r scaledGreen:g scaledBlue:b
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9216
    "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
  9217
     (i.e. colorID)"
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9218
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9219
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9220
    int id, ir, ig, ib;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9221
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  9222
    if (__bothSmallInteger(r, g) && __isSmallInteger(b)) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  9223
	id = RGB2st(__intVal(r),__intVal(g),__intVal(b));
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9224
	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
  9225
	RETURN ( __MKSMALLINT(id) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9226
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9227
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9228
    self primitiveFailed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9229
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9230
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9231
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9232
freeColor:colorIndex
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  9233
    "free a display color when its no longer needed.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  9234
     A dummy here, since RGB colors are never freed."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9235
4074
b40ae99d0f76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4059
diff changeset
  9236
    "/ 'free color' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9237
    ^ self
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9238
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9239
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9240
getRGBFrom:index into:aBlock
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9241
    "get rgb components (0..100) of color in map at:index,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9242
     and evaluate the 3-arg block, aBlock with them"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9243
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9244
    |val|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9245
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9246
    self getScaledRGBFrom:index into:[:r :g :b |
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  9247
	val := aBlock
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  9248
		value:(r * 100.0 / 16rFFFF)
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  9249
		value:(g * 100.0 / 16rFFFF)
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  9250
		value:(b * 100.0 / 16rFFFF)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9251
    ].
4074
b40ae99d0f76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4059
diff changeset
  9252
    "/ 'get RGB' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9253
    ^ val
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9254
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9255
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9256
getRGBFromName:colorName into:aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9257
    "get rgb components (0..100) of color named colorName,
5338
e447c6b3ed77 colorName:ifIllegal: - did return black for illegal color,
Claus Gittinger <cg@exept.de>
parents: 5335
diff changeset
  9258
     and evaluate the 3-arg block, aBlock with them.
e447c6b3ed77 colorName:ifIllegal: - did return black for illegal color,
Claus Gittinger <cg@exept.de>
parents: 5335
diff changeset
  9259
     Return nil for unknown color names."
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9260
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9261
    |val|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9262
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9263
    self getScaledRGBFromName:colorName into:[:r :g :b |
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9264
	r isNil ifTrue:[^nil].
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9265
	val := aBlock
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9266
		value:(r * 100.0 / 16rFFFF)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9267
		value:(g * 100.0 / 16rFFFF)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9268
		value:(b * 100.0 / 16rFFFF)
5338
e447c6b3ed77 colorName:ifIllegal: - did return black for illegal color,
Claus Gittinger <cg@exept.de>
parents: 5335
diff changeset
  9269
    ].
e447c6b3ed77 colorName:ifIllegal: - did return black for illegal color,
Claus Gittinger <cg@exept.de>
parents: 5335
diff changeset
  9270
    ^ val
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9271
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9272
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9273
getScaledRGBFrom:index into:aBlock
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9274
    "get rgb components (0 .. 16rFFFF) of color in map at:index,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9275
     and evaluate the 3-arg block, aBlock with them"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9276
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9277
    |r g b|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9278
%{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9279
    int id = __intVal(index);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9280
    int iR, iG, iB;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9281
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9282
    id = st2RGB(id,0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9283
    iR = id & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9284
    iG = (id >> 8) & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9285
    iB = (id >> 16) & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9286
    iR = (iR << 8) | iR;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9287
    iG = (iG << 8) | iG;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9288
    iB = (iB << 8) | iB;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9289
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9290
    r = __MKSMALLINT(iR);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9291
    g = __MKSMALLINT(iG);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9292
    b = __MKSMALLINT(iB);
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  9293
    /*console_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
  9294
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9295
    ^ aBlock value:r value:g value:b
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9296
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9297
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9298
getScaledRGBFromName:colorName into:aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9299
    "get scaled rgb components (0..16rFFFF) of color named colorName,
5338
e447c6b3ed77 colorName:ifIllegal: - did return black for illegal color,
Claus Gittinger <cg@exept.de>
parents: 5335
diff changeset
  9300
     and evaluate the 3-arg block, aBlock with them.
e447c6b3ed77 colorName:ifIllegal: - did return black for illegal color,
Claus Gittinger <cg@exept.de>
parents: 5335
diff changeset
  9301
     Return nil for unknown color names."
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9302
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  9303
    |triple r g b found cName|
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9304
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9305
    r := g := b := 0.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9306
    found := false.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9307
    (colorName startsWith:$#) ifTrue:[
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9308
	"/ color in r/g/b hex notation
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9309
	r := Integer readFrom:(colorName copyFrom:2 to:3) radix:16.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9310
	g := Integer readFrom:(colorName copyFrom:4 to:5) radix:16.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9311
	b := Integer readFrom:(colorName copyFrom:6 to:7) radix:16.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9312
	found := true.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9313
    ] ifFalse:[
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9314
	cName := colorName asString.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9315
	triple := StandardColorValues at:cName ifAbsent:nil.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9316
	triple isNil ifTrue:[
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9317
	    "/ try lowercase name
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9318
	    cName := cName asLowercase.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9319
	    triple := StandardColorValues at:cName ifAbsent:nil.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9320
	    triple isNil ifTrue:[
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9321
		"/ try lowercase without intermixed spaces
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9322
		cName := cName asCollectionOfWords asStringWith:nil.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9323
		triple := StandardColorValues at:cName ifAbsent:nil.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9324
	    ].
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9325
	].
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9326
	triple notNil ifTrue:[
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9327
	    r := triple at:1.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9328
	    g := triple at:2.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9329
	    b := triple at:3.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9330
	    found := true.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9331
	].
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9332
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9333
    found ifFalse:[
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9334
	"/ ('WinWorkstation: unknown color: ' , colorName) infoPrintCR.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9335
	^ nil.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9336
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9337
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9338
    ^ 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
  9339
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9340
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9341
listOfAvailableColors
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9342
    "return a list of all available colornames.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9343
     This should not be used, since colornames are very
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9344
     display-specific (here X-specific)."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9345
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9346
    |aStream list line index colorName|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9347
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9348
    aStream := FileStream readonlyFileNamed:'/usr/lib/X11/rgb.txt'.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9349
    aStream isNil ifTrue:[^ nil].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9350
    list := OrderedCollection new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9351
    [aStream atEnd] whileFalse:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9352
	line := aStream nextLine.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9353
	line notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9354
	    "skip the r/g/b numbers"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9355
	    index := 1.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9356
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9357
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9358
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9359
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9360
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9361
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9362
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9363
	    colorName := line copyFrom:index.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9364
	    ((colorName occurrencesOf:(Character space)) == 0) ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9365
		list add:colorName
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9366
	    ]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9367
	]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9368
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9369
    aStream close.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9370
    ^ list sort
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9371
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9372
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9373
     Screen current listOfAvailableColors
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9374
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9375
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9376
    "Modified: 11.9.1996 / 15:26:28 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9377
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9378
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9379
percentToDeviceColorValue:aPercentage
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9380
    "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
  9381
     WIN-component value (0..16rFFFF) as an integer"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9382
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9383
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9384
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9385
    if (__isSmallInteger(aPercentage)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9386
	RETURN ( __MKSMALLINT(0xFFFF * __intVal(aPercentage) / 100) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9387
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9388
    if (__isFloat(aPercentage)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9389
	RETURN ( __MKSMALLINT(0xFFFF * (int)(__floatVal(aPercentage)) / 100) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9390
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9391
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9392
    ^ (16rFFFF * aPercentage / 100) rounded
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9393
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9394
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9395
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
  9396
    "change a palette index.
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9397
     This is not yet supported in the Windows Device
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9398
     - 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
  9399
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9400
     '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
  9401
     ^ self.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9402
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9403
    "Created: 30.1.1998 / 09:27:48 / md"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9404
    "Modified: 30.1.1998 / 09:30:22 / md"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9405
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9406
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9407
!WinWorkstation methodsFor:'cursor stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9408
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9409
builtInCursorShapes
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9410
    "return a collection of standard cursor names.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9411
     Those are built into Windows and need not be created as
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9412
     user cursors.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9413
     (actually, there are more than those below ...)"
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9414
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9415
    "/ if you add something here, also add to #shapeNumberFromCursor ...
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9416
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9417
    ^ #(
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9418
	#upLeftArrow            "/ IDC_ARROW
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9419
	#upDownArrow            "/ IDC_SIZENS
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9420
	#leftRightArrow         "/ IDC_SIZEWE
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9421
	#text                   "/ IDC_IBEAM
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9422
	#wait                   "/ IDC_WAIT
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9423
	#execute                "/ IDC_APPSTARTING
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9424
	#crossHair              "/ IDC_CROSS
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9425
	#fourWay                "/ IDC_SIZEALL
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9426
	#upRightHand            "/ IDC_ARROW
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9427
	#noDrop                 "/ IDC_NO
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9428
	#stop                   "/ IDC_NO
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9429
       )
3110
0058dbbb19df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3109
diff changeset
  9430
0058dbbb19df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3109
diff changeset
  9431
    "Modified: / 10.12.1999 / 15:16:26 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9432
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9433
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9434
createCursorShape:aShape
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9435
    "create a cursor given a shape-symbol"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9436
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9437
    |number|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9438
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9439
    number := self shapeNumberFromSymbol:aShape.
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9440
    number isNil ifTrue:[^ nil].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9441
    ^ self primCreateCursorShapeNr:number
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9442
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9443
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9444
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
  9445
    "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
  9446
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9447
    |padding bpl bplPadded srcOffs dstOffs
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9448
     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
  9449
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  9450
    cW := self getSystemMetrics:#SM_CXCURSOR.
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  9451
    cH := self getSystemMetrics:#SM_CYCURSOR.
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9452
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9453
    "/ ('cursorWidth ',cW printString,'cursorHeight ',cH printString) infoPrintCR.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9454
    src := sourceBytes.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9455
    mask := maskBytes.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9456
    padding := self cursorBitmapPadding.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9457
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9458
    "/ repadding and/or resizing required ?
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9459
    bpl := sourceBytes size / h.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9460
    bplPadded := (cW + padding - 1) // padding * 2.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9461
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9462
    bpl ~~ bplPadded ifTrue:[
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9463
	 "/     'repad cursor bits' infoPrintCR.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9464
	srcPadded := ByteArray new:(bplPadded * cH).
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9465
	nB := bpl min: bplPadded.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9466
	nR := cH min: h.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9467
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9468
	dstOffs := srcOffs := 1.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9469
	1 to:nR do:[:row |
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9470
	    srcPadded
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9471
		replaceFrom:dstOffs
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9472
		to:(dstOffs+nB-1)
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9473
		with:src
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9474
		startingAt:srcOffs.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9475
	    dstOffs := dstOffs + bplPadded.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9476
	    srcOffs := srcOffs + bpl.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9477
	].
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9478
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9479
	maskPadded := ByteArray new:(bplPadded * cH).
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9480
	dstOffs := srcOffs := 1.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9481
	1 to:nR do:[:row |
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9482
	    maskPadded
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9483
		replaceFrom:dstOffs
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9484
		to:(dstOffs+nB-1)
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9485
		with:mask
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9486
		startingAt:srcOffs.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9487
	    dstOffs := dstOffs + bplPadded.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9488
	    srcOffs := srcOffs + bpl.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9489
	].
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9490
	src := srcPadded.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9491
	mask := maskPadded.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9492
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9493
    ].
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9494
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9495
    src invert.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9496
    1 to:src size do:[:index |
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9497
	src byteAt:index put:((src byteAt:index) bitAnd:(mask byteAt:index)).
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9498
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9499
    mask invert.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9500
    cursor := self
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9501
	primCreateCursorSourceBits:src
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9502
	maskBits:mask
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9503
	hotX:hx hotY:hy
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9504
	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
  9505
    cursor notNil ifTrue:[^ cursor ].
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9506
    'WinWorkstation [warning]: could not create bitmap cursor' infoPrintCR.
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  9507
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  9508
    "Modified: / 08-09-2006 / 15:39:42 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9509
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9510
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9511
cursorBitmapPadding
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9512
    ^ 16 "/ windows requires short-padded rows
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9513
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9514
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9515
destroyCursor:aCursorId
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9516
    "destroy a cursor"
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9517
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9518
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9519
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9520
    if (ISCONNECTED) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9521
	if (__isExternalAddress(aCursorId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9522
	    HCURSOR curs = _HCURSORVal(aCursorId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9523
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9524
	    if (curs) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9525
#ifdef KEEP_STD_CURSORS
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9526
		if ((curs != H_C_ARROW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9527
		 && (curs != H_C_CROSS)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9528
		 && (curs != H_C_IBEAM)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9529
		 && (curs != H_C_ICON)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9530
		 && (curs != H_C_NO)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9531
		 && (curs != H_C_SIZE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9532
		 && (curs != H_C_SIZEALL)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9533
		 && (curs != H_C_SIZENESW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9534
		 && (curs != H_C_SIZENS)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9535
		 && (curs != H_C_SIZENWSE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9536
		 && (curs != H_C_UPARROW)
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9537
		 && (curs != H_C_APPSTARTING)
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9538
		 && (curs != H_C_WAIT))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9539
#endif /* KEEP_STD_CURSORS */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9540
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9541
		    DestroyCursor(curs);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9542
#ifdef COUNT_RESOURCES
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9543
		    __cnt_cur--;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9544
		    RESPRINTF(("DestroyCursor %d\n",__cnt_cur));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9545
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9546
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9547
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9548
	    RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9549
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9550
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9551
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9552
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9553
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9554
needDeviceFormsForCursor
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9555
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9556
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9557
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9558
primCreateCursorShapeNr:number
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9559
    " create a standard (shape) cursor"
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9560
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  9561
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9562
    HCURSOR newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9563
    LPCTSTR cId;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9564
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9565
    if (__isSmallInteger(number)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9566
	cId = (LPCTSTR)(__intVal(number));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9567
	newCursor = LoadCursor(NULL, cId);
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  9568
	if (newCursor) {
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  9569
#ifdef KEEP_STD_CURSORS
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9570
	    if (cId == IDC_ARROW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9571
		H_C_ARROW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9572
	    else if (cId == IDC_CROSS)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9573
		H_C_CROSS = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9574
	    else if (cId == IDC_IBEAM)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9575
		H_C_IBEAM = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9576
	    else if (cId == IDC_ICON)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9577
		H_C_ICON = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9578
	    else if (cId == IDC_NO)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9579
		H_C_NO = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9580
	    else if (cId == IDC_SIZE)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9581
		H_C_SIZE = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9582
	    else if (cId == IDC_SIZEALL)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9583
		H_C_SIZEALL = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9584
	    else if (cId == IDC_SIZENESW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9585
		H_C_SIZENESW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9586
	    else if (cId == IDC_SIZENS)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9587
		H_C_SIZENS = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9588
	    else if (cId == IDC_SIZENWSE)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9589
		H_C_SIZENWSE = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9590
	    else if (cId == IDC_UPARROW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9591
		H_C_UPARROW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9592
	    else if (cId == IDC_WAIT)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9593
		H_C_WAIT = newCursor;
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9594
	    else if (cId == IDC_APPSTARTING)
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9595
		H_C_APPSTARTING = newCursor;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9596
#endif /* KEEP_STD_CURSORS */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9597
	    RETURN ( __MKOBJ(newCursor) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9598
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9599
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9600
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9601
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9602
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9603
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9604
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
  9605
    "create a cursor from given pixels"
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9606
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9607
%{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9608
    HCURSOR newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9609
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9610
    if (__isByteArray(src)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9611
     && __isByteArray(mask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9612
     && __bothSmallInteger(hx, hy)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9613
     && __bothSmallInteger(w, h)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9614
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9615
	newCursor = CreateCursor((HANDLE) __getHInstance(),
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9616
				 __intVal(hx), __intVal(hy),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9617
				 __intVal(w), __intVal(h),
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9618
				 __ByteArrayInstPtr(mask)->ba_element,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9619
				 __ByteArrayInstPtr(src)->ba_element);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9620
	if (newCursor) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9621
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9622
	    __cnt_cur++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9623
	    RESPRINTF(("CreateCursor %d\n",__cnt_cur));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9624
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9625
	    RETURN ( __MKOBJ(newCursor));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9626
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9627
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9628
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9629
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9630
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9631
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9632
shapeNumberFromSymbol:shape
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9633
    "given a shape-symbol, return the corresponding cursor-number,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9634
     or nil if no such standard cursor exists."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9635
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9636
    "this is pure Win-knowlegde - but you may easily add more"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9637
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9638
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9639
    if (shape == @symbol(upRightHand)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9640
	RETURN ( __MKSMALLINT( (INT)IDC_ARROW));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9641
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9642
    if (shape == @symbol(upLeftArrow)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9643
	RETURN ( __MKSMALLINT( (INT)IDC_ARROW));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9644
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9645
    if (shape == @symbol(upDownArrow)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9646
	RETURN ( __MKSMALLINT( (INT)IDC_SIZENS));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9647
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9648
    if (shape == @symbol(leftRightArrow)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9649
	RETURN ( __MKSMALLINT( (INT)IDC_SIZEWE));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9650
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9651
    if (shape == @symbol(text)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9652
	RETURN ( __MKSMALLINT( (INT)IDC_IBEAM));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9653
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9654
    if (shape == @symbol(wait)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9655
	RETURN ( __MKSMALLINT( (INT)IDC_WAIT));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9656
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9657
    if (shape == @symbol(crossHair)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9658
	RETURN ( __MKSMALLINT( (INT)IDC_CROSS));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9659
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9660
    if (shape == @symbol(fourWay)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9661
	RETURN ( __MKSMALLINT( (INT)IDC_SIZEALL));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9662
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9663
    if (shape == @symbol(execute)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9664
	RETURN ( __MKSMALLINT( (INT)IDC_APPSTARTING));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9665
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9666
    if (shape == @symbol(noDrop)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9667
	RETURN ( __MKSMALLINT( (INT)IDC_NO));
3110
0058dbbb19df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3109
diff changeset
  9668
    }
0058dbbb19df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3109
diff changeset
  9669
    if (shape == @symbol(stop)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9670
	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
  9671
    }
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9672
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9673
    if (shape == @symbol(IDC_UPARROW)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9674
	RETURN ( __MKSMALLINT( (INT)IDC_UPARROW));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9675
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9676
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9677
    if (shape == @symbol(IDC_SIZE)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9678
	RETURN ( __MKSMALLINT( (INT)IDC_SIZE));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9679
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9680
    if (shape == @symbol(IDC_SIZENWSE)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9681
	RETURN ( __MKSMALLINT( (INT)IDC_SIZENWSE));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9682
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9683
    if (shape == @symbol(IDC_SIZENESW)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9684
	RETURN ( __MKSMALLINT( (INT)IDC_SIZENESW));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9685
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9686
    if (shape == @symbol(IDC_NO)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9687
	RETURN ( __MKSMALLINT( (INT)IDC_NO));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9688
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9689
#ifdef IDC_HELP
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9690
    if (shape == @symbol(IDC_HELP)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9691
	RETURN ( __MKSMALLINT( (INT)IDC_HELP));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9692
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9693
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9694
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9695
"/    ('WINWORKSTATION: invalid cursorShape:' , shape printString) infoPrintNL.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9696
    ^  nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9697
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9698
4461
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9699
!WinWorkstation methodsFor:'drag & drop'!
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9700
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9701
dragFinish:dropHandle
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9702
    "free Win32 data (and remove the drop-file)"
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9703
%{
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9704
    if (__isExternalAddress(dropHandle)) {
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9705
	HDROP hDrop = (HDROP)(__MKCP(dropHandle));
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9706
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9707
	__externalAddressVal(dropHandle) = 0;
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9708
	if (hDrop) {
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9709
	    DragFinish(hDrop);
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9710
	}
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9711
    }
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9712
%}
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9713
! !
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9714
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9715
!WinWorkstation methodsFor:'drawing'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9716
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9717
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
  9718
		width:w height:h
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9719
    "do a bit-blt; copy bits from the rectangle defined by
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9720
     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
  9721
     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
  9722
     argument is not integer."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9723
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9724
%{
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  9725
    struct gcData *dstGcData = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9726
    struct gcData *srcGcData = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9727
    HDC srcDC = (HDC)0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9728
    HDC dstDC = (HDC)0;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9729
    int     dstGcOwnerThreadID;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9730
    HWND    dstGcHWIN;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9731
    HBITMAP dstGcHBITMAP;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9732
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9733
    if (! __isExternalAddress(srcGCId)
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9734
     || ! __isExternalAddress(dstGCId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9735
	goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9736
    }
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9737
    srcGcData = _GCDATA(srcGCId);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9738
    dstGcData = _GCDATA(dstGCId);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9739
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9740
    if (__bothSmallInteger(w, h)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9741
     && __bothSmallInteger(srcX, srcY)
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9742
     && __bothSmallInteger(dstX, dstY)
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9743
     && srcGcData
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9744
     && dstGcData) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9745
	int fun = BITBLT_COPY;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9746
	int src_fg, src_bg, dst_fg, dst_bg;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9747
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9748
	fun = dstGcData->bitbltrop2;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9749
#if 0
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9750
	switch (fun) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9751
	  case BITBLT_COPY:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  9752
	    console_printf("BITBLT_COPY\n");
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9753
	    break;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9754
	  case BITBLT_COPYINVERTED:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  9755
	    console_printf("BITBLT_COPYINVERTED\n");
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9756
	    break;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9757
	  case BITBLT_XOR:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  9758
	    console_printf("BITBLT_XOR\n");
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9759
	    break;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9760
	  case BITBLT_AND:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  9761
	    console_printf("BITBLT_AND\n");
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9762
	    break;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9763
	  case BITBLT_OR:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  9764
	    console_printf("BITBLT_OR\n");
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9765
	    break;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9766
	}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9767
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9768
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9769
	/*
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9770
	 * a scroll operation ?
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9771
	 */
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9772
	if (srcGcData->hWnd
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9773
	 && ((srcGcData->hWnd == dstGcData->hWnd)
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9774
	 && (fun == BITBLT_COPY))) {
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  9775
	    RECT rec, updRect;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9776
	    RECT invRec;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9777
	    HRGN updRgn = 0, dstRgn = 0, nUpdRgn = 0;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9778
	    int _srcX = __intVal(srcX);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9779
	    int _srcY = __intVal(srcY);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9780
	    int _dstX = __intVal(dstX);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9781
	    int _dstY = __intVal(dstY);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9782
	    int _w = __intVal(w);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9783
	    int _h = __intVal(h);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9784
	    int noExpose = 0;
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9785
	    int _deltaX, _deltaY;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9786
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  9787
#ifdef CACHE_LAST_DC
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9788
	    if (lastGcData) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9789
		_releaseDC(lastGcData);
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9790
	    }
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9791
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9792
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9793
	    rec.left = _srcX;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9794
	    rec.top  = _srcY;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9795
	    rec.right = rec.left + _w;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9796
	    rec.bottom = rec.top + _h;
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9797
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9798
	    _deltaX = _dstX - _srcX;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9799
	    _deltaY = _dstY - _srcY;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9800
4265
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  9801
	    DDPRINTF(("dst and src is HWND %x fun == BITBLT_COPY --> scroll %d/%d\n",
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9802
		    srcGcData->hWnd,
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9803
		    _deltaX,
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9804
		    _deltaY));
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9805
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9806
	    if ((_deltaX == 0) && (_deltaY == 0)) {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9807
		noExpose = 1;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9808
	    } else {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9809
		updRgn = CreateRectRgn(0, 0, 0, 0);
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9810
		ScrollWindowEx(srcGcData->hWnd,
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9811
			    _deltaX,
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9812
			    _deltaY,
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9813
			    &rec,            /* area to scroll */
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9814
			    0,               /* clip region */
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9815
			    updRgn,
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9816
			    NULL, /* &invRec, */
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9817
			    0 /* SW_ERASE | SW_INVALIDATE */);
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9818
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9819
		/*
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9820
		 * we are not interested in the source-area;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9821
		 * only care for exposed areas in the dst area.
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9822
		 */
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9823
		dstRgn = CreateRectRgn(_dstX, _dstY, _dstX+_w, _dstY+_h);
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9824
		nUpdRgn = CreateRectRgn(0, 0, 0, 0);
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9825
		switch (CombineRgn(nUpdRgn, updRgn, dstRgn, RGN_AND)) {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9826
		    case ERROR:
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9827
			_DeleteObject(nUpdRgn, __LINE__);
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9828
			nUpdRgn = updRgn;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9829
			noExpose = 1;
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9830
			break;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9831
		    case NULLREGION:
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9832
			noExpose = 1;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9833
			break;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9834
		    default:
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9835
			if (__generateExposes(srcGcData->hWnd, nUpdRgn, __WM_GEXPOSE, 1) <= 0) {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9836
			    noExpose = 1;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9837
			}
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9838
			break;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9839
		}
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9840
	    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9841
	    if (noExpose) {
2705
d16abb07c15b fixed graphicsExpose/noExpose handling (final-flag was wrong)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  9842
		/*
d16abb07c15b fixed graphicsExpose/noExpose handling (final-flag was wrong)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
  9843
		 * 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
  9844
		 */
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  9845
		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
  9846
	    }
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9847
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9848
	    if (dstRgn) {
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  9849
		_DeleteObject(dstRgn, __LINE__);
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9850
	    }
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9851
	    if (nUpdRgn && (nUpdRgn != updRgn)) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9852
		_DeleteObject(nUpdRgn, __LINE__);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9853
	    }
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9854
	    if (updRgn) {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9855
		_DeleteObject(updRgn, __LINE__);
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  9856
	    }
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9857
	    RETURN ( self );
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9858
	}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9859
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9860
	fun = dstGcData->bitbltrop2;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9861
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9862
	if (0 /* fun == BITBLT_COPY */) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9863
	    src_fg = dst_fg = 0xFFFFFF;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9864
	    src_bg = dst_bg = 0x000000;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9865
	} else {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9866
	    src_fg = srcGcData->fgColor;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9867
	    src_bg = srcGcData->bgColor;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9868
	    dst_fg = dstGcData->fgColor;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9869
	    dst_bg = dstGcData->bgColor;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9870
	}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9871
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9872
	/*
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9873
	 * a simple copy (like scroll, but in a bitmap) ?
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9874
	 */
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9875
	if ((srcGcData == dstGcData)
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9876
	 && (fun == BITBLT_COPY)) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9877
	    RECT rec, uprec;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9878
	    int _srcX, _srcY;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9879
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9880
	    rec.left = _srcX = __intVal(srcX);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9881
	    rec.top = _srcY = __intVal(srcY);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9882
	    rec.right = rec.left + __intVal(w);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9883
	    rec.bottom = rec.top + __intVal(h);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9884
	    srcDC = _getDC(srcGcData);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9885
	    SetBkColor(srcDC, src_fg);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9886
	    SetTextColor(srcDC, src_bg);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9887
4265
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  9888
	    DDPRINTF(("dst and src is DC %x fun == BITBLT_COPY  --> scrolling %d %d\n",srcDC,__intVal(dstX) - __intVal(srcX),__intVal(dstY) - __intVal(srcY)));
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9889
	    ScrollDC(srcDC, __intVal(dstX)-_srcX,
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9890
			    __intVal(dstY)-_srcY,
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9891
			    &rec, 0, 0, &uprec);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9892
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9893
	    SetBkColor(srcDC, srcGcData->bgColor);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9894
	    SetTextColor(srcDC, srcGcData->fgColor);
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9895
#ifndef CACHE_LAST_DC
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9896
	    _releaseDC(srcGcData);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9897
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9898
	    RETURN ( self );
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9899
	}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9900
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9901
#ifdef xxCACHE_LAST_DC
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9902
/* mhmh - this should not be needed */
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9903
	if (lastGcData) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9904
	    _releaseDC(lastGcData);
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9905
	}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9906
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9907
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9908
	if (dstGcData == srcGcData) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9909
	    srcDC = dstDC = _getDC(dstGcData);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9910
	} else {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9911
	    srcDC = _getDC(srcGcData);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9912
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9913
	    /*
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9914
	     * kludge - pretent nothing is cached for a moment,
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9915
	     * to avoid release in getDC below ...
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9916
	     */
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9917
#ifdef CACHE_LAST_DC
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9918
	    dstGcOwnerThreadID = lastGcOwnerThreadID;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9919
	    dstGcHWIN = lastGcHWIN;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9920
	    dstGcHBITMAP = lastGcHBITMAP;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9921
	    lastGcData = 0;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  9922
#endif
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9923
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9924
	    dstDC = _getDC(dstGcData);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9925
	    SetBkColor(dstDC, dst_fg);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9926
	    SetTextColor(dstDC, dst_bg);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9927
	}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9928
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9929
	SetBkColor(srcDC, src_fg);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9930
	SetTextColor(srcDC, src_bg);
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9931
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9932
	CPRINTF(("bitblt src f:%x b:%x",GetTextColor(srcDC),GetBkColor(srcDC)));
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9933
	CPRINTF(("dst f:%x b:%x\n",GetTextColor(dstDC),GetBkColor(dstDC)));
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9934
	if (BitBlt(dstDC,
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9935
	     __intVal(dstX), __intVal(dstY),
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9936
	     __intVal(w), __intVal(h),
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9937
	     srcDC,
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9938
	     __intVal(srcX), __intVal(srcY),
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9939
	     fun)
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9940
	   == 0
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9941
	  ) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  9942
	    console_fprintf(stderr, "WinWorkstation [info]: ERROR in BitBlt\n");
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9943
	}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9944
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9945
	if (dstGcData != srcGcData) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9946
	    SetBkColor(dstDC, dstGcData->bgColor);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9947
	    SetTextColor(dstDC, dstGcData->fgColor);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9948
	}
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9949
	SetBkColor(srcDC, srcGcData->bgColor);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9950
	SetTextColor(srcDC, srcGcData->fgColor);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9951
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9952
	if (srcGcData != dstGcData) {
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9953
	    _releaseDC(srcGcData);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9954
	}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9955
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9956
#ifdef CACHE_LAST_DC
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9957
	/*
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9958
	 * kludge again - restore last-DC cache
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9959
	 */
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9960
	lastGcData = dstGcData;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9961
	lastGcOwnerThreadID = dstGcOwnerThreadID;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9962
	lastGcHWIN = dstGcHWIN;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9963
	lastGcHBITMAP = dstGcHBITMAP;
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
  9964
#else
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9965
	_releaseDC(dstGcData);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9966
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9967
	RETURN ( self );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9968
    }
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  9969
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9970
 fail: ;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9971
%}.
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9972
    self primitiveFailed.
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9973
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9974
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9975
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9976
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
  9977
		width:w height:h
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9978
    "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
  9979
     copy bits from the rectangle defined by
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9980
     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
  9981
     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
  9982
     argument is not integer."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9983
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9984
    ^ self
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9985
	copyFromId:sourceId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9986
		 x:srcX y:srcY gc:srcDCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9987
		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
  9988
	     width:w height:h
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9989
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9990
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  9991
displayArcX:x y:y width:width height:height from:startAngle angle:angle in:ignoredDrawableId with:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9992
    "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
  9993
     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
  9994
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
  9995
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9996
    int __x, __y, w, h;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9997
    float angle1, angle2;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9998
    double f;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9999
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10000
    if (__isSmallInteger(startAngle))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10001
	angle1 = (float)(__intVal(startAngle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10002
    else if (__isFloat(startAngle)) {
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10003
	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
 10004
    } else if (__isShortFloat(startAngle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
 10005
	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
 10006
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10007
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10008
    if (__isSmallInteger(angle))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10009
	angle2 = (float)(__intVal(angle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10010
    else if (__isFloat(angle)) {
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10011
	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
 10012
    } else if (__isShortFloat(angle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
 10013
	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
 10014
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10015
2930
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10016
    if (angle2 <= 0) {
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10017
	RETURN (self);
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10018
    }
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10019
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10020
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10021
     && __bothSmallInteger(x, y)
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 10022
     && __bothSmallInteger(width, height))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10023
     {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10024
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10025
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 10026
	POINT p;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10027
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10028
	w = __intVal(width);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10029
	h = __intVal(height);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10030
	__x = __intVal(x);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10031
	__y = __intVal(y);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10032
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10033
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10034
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10035
	if (! GcDataGetPen(hDC, gcData)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10036
	    DPRINTF(("displayArc: no pen\n"));
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10037
	} else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10038
	    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
 10039
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10040
	    xR = w / 2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10041
	    yR = h / 2;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10042
	    if (angle2 - angle1 >= 360) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10043
		xB = xE = __x + xR + 0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10044
		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
 10045
	    } else {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10046
		double sin(), cos();
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10047
		float rad1, rad2;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10048
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10049
		if (angle1 <= 180)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10050
		  angle1 = 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10051
		else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10052
		  angle1 = 360 + 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10053
		angle2 = angle1 - angle2;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10054
		/* sigh - compute the intersections ... */
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10055
		rad1 = (angle1 * 3.14159265359) / 180.0;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10056
		rad2 = (angle2 * 3.14159265359) / 180.0;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10057
		xB = cos(rad1) * xR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10058
		yB = sin(rad1) * yR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10059
		xE = cos(rad2) * xR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10060
		yE = sin(rad2) * yR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10061
		xB = __x + xR - xB + 0.5;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10062
		yB = __y + yR - yB + 0.5;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10063
		xE = __x + xR - xE + 0.5;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10064
		yE = __y + yR - yE + 0.5;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10065
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10066
	    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
 10067
	    Arc(hDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10068
		__x, __y,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10069
		__x + w, __y + h,
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10070
		(int)xB, (int)yB,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10071
		(int)xE, (int)yE);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10072
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10073
	    GcDataReleasePen(hDC, gcData);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10074
	}
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10075
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10076
	_releaseDC(gcData);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10077
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10078
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10079
    }
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10080
    bad: ;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10081
%}.
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10082
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10083
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10084
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10085
displayLineFromX:x0 y:y0 toX:x1 y:y1 in:ignoredDrawableId with:aGCId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10086
    "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
 10087
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10088
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10089
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10090
     && __bothSmallInteger(x0, y0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10091
     && __bothSmallInteger(x1, y1)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10092
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10093
	int __x1 = __intVal(x1), __y1 = __intVal(y1);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10094
	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
 10095
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10096
/*      DPRINTF(("displayLine: %d/%d -> %d/%d\n",
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10097
		    __intVal(x0), __intVal(y0),
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10098
		    __x1, __y1));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10099
*/
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10100
	if (! GcDataGetPen(hDC, gcData)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10101
	    DPRINTF(("displayLine: no pen\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10102
	} else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10103
	    MoveToEx(hDC, __intVal(x0), __intVal(y0), NULL);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10104
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10105
	    LineTo(hDC, __x1, __y1);
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 10106
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10107
	    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10108
	     * end-point ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10109
	     */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10110
	    LineTo(hDC, __x1+1, __y1);
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 10111
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10112
	    GcDataReleasePen(hDC, gcData);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10113
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10114
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10115
	_releaseDC(gcData);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10116
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10117
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10118
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10119
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10120
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10121
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10122
displayPointX:px y:py in:ignoredDrawableId with:aGCId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10123
    "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
 10124
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10125
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10126
    if (__isExternalAddress(aGCId)
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 10127
     && __bothSmallInteger(px, py)) {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10128
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10129
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 10130
	POINT p;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10131
	int __x = __intVal(px), __y = __intVal(py);
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 10132
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 10133
#ifdef OLD
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10134
	int savedLStyle = gcData->lStyle;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10135
	int savedLWidth = gcData->lineWidth;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10136
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10137
	/*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10138
	 * 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
 10139
	 */
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10140
	if ((gcData->lStyle != PS_SOLID)
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10141
	 || (gcData->lineWidth > 1)) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10142
	    FLUSH_CACHED_DC(gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10143
	    gcData->lStyle = PS_SOLID;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10144
	    gcData->lineWidth = 0;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10145
	}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10146
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10147
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10148
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10149
	if (! GcDataGetPen(hDC,gcData)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10150
	    DPRINTF(("displayPoint: no pen\n"));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10151
	} else {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10152
	    MoveToEx(hDC, __x, __y, NULL);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10153
	    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10154
	     * end-point ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10155
	     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10156
	    LineTo(hDC, __x+1, __y);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10157
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10158
	    GcDataReleasePen(hDC, gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10159
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10160
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10161
# ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10162
	_releaseDC(gcData);
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10163
# endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10164
	if ((gcData->lStyle != savedLStyle)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10165
	 || (gcData->lineWidth != savedLWidth)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10166
	    FLUSH_CACHED_DC(gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10167
	    gcData->lStyle = savedLStyle;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10168
	    gcData->lineWidth = savedLWidth;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10169
	}
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 10170
#else /* NEW */
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 10171
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10172
	hDC = _getDC(gcData);
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 10173
	SetPixelV(hDC, __x, __y, gcData->fgColor);
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10174
# ifndef CACHE_LAST_DC
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10175
	_releaseDC(gcData);
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10176
# endif
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 10177
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 10178
#endif /* NEW */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10179
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10180
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10181
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10182
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10183
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10184
displayPolygon:aPolygon in:ignoredDrawableId with:aGCId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10185
    "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
 10186
     which define the polygon.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10187
     If any coordinate is not integer, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10188
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10189
    |numberOfPoints|
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10190
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10191
    numberOfPoints := aPolygon size.
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10192
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10193
%{
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10194
    OBJ point, px, py;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10195
    int i, num;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10196
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10197
    if (__isExternalAddress(aGCId)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10198
     && __isSmallInteger(numberOfPoints)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10199
	struct gcData *gcData = _GCDATA(aGCId);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10200
	HDC hDC = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10201
	POINT p;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10202
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10203
	num = __intVal(numberOfPoints);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10204
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10205
	for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10206
	    point = __AT_(aPolygon, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10207
	    if (! __isPoint(point)) goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10208
	    px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10209
	    py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10210
	    if (! __bothSmallInteger(px, py)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10211
		goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10212
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10213
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10214
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10215
	hDC = _getDC(gcData);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10216
	if (! GcDataGetPen(hDC,gcData)) {
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10217
	    DPRINTF(("displayPolygon: no pen\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10218
	} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10219
	    for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10220
		point = __AT_(aPolygon, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10221
		px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10222
		py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10223
		p.x = __intVal(px);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10224
		p.y = __intVal(py);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10225
		if (i == 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10226
		    MoveToEx(hDC, p.x, p.y, NULL);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10227
		} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10228
		    if (i == (num-1)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10229
			PolylineTo(hDC, &p, 1);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10230
		    } else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10231
			LineTo(hDC, p.x, p.y);
4181
91439783248a bugfix: display polygon PRE_04_JUN_04
ca
parents: 4161
diff changeset
 10232
#ifdef PRE_04_JUN_04
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10233
			/*
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10234
			 * end-point ...
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10235
			 */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10236
			LineTo(hDC, p.x+1, p.y);
4181
91439783248a bugfix: display polygon PRE_04_JUN_04
ca
parents: 4161
diff changeset
 10237
#endif
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10238
		    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10239
		}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10240
	    }
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10241
	    GcDataReleasePen(hDC, gcData);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10242
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10243
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10244
#ifndef CACHE_LAST_DC
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10245
	_releaseDC(gcData);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10246
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10247
	RETURN ( self );
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10248
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10249
fail: ;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10250
%}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10251
!
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10252
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10253
displayPolylines:aPolyline in:ignoredDrawableId with:aGCId
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10254
    "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
 10255
     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
 10256
     If any coordinate is not integer, an error is triggered."
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10257
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10258
    |numberOfPoints|
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10259
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10260
    numberOfPoints := aPolyline size.
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10261
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10262
%{
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10263
    OBJ point, px, py;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10264
    int i, num;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10265
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10266
    if (__isExternalAddress(aGCId)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10267
     && __isSmallInteger(numberOfPoints)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10268
	struct gcData *gcData = _GCDATA(aGCId);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10269
	HDC hDC = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10270
	POINT p;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10271
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10272
	num = __intVal(numberOfPoints);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10273
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10274
	for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10275
	    point = __AT_(aPolyline, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10276
	    if (! __isPoint(point)) goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10277
	    px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10278
	    py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10279
	    if (! __bothSmallInteger(px, py)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10280
		goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10281
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10282
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10283
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10284
	hDC = _getDC(gcData);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10285
	if (! GcDataGetPen(hDC,gcData)) {
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10286
	    DPRINTF(("displayPolygon: no pen\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10287
	} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10288
	    for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10289
		point = __AT_(aPolyline, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10290
		px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10291
		py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10292
		p.x = __intVal(px);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10293
		p.y = __intVal(py);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10294
		if ((i & 1) == 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10295
		    MoveToEx(hDC, p.x, p.y, NULL);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10296
		} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10297
		    LineTo(hDC, p.x, p.y);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10298
		    /*
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10299
		     * end-point ...
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10300
		     */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10301
		    LineTo(hDC, p.x+1, p.y);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10302
		}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10303
	    }
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10304
	    GcDataReleasePen(hDC, gcData);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10305
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10306
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10307
#ifndef CACHE_LAST_DC
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10308
	_releaseDC(gcData);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10309
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10310
	RETURN ( self );
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10311
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10312
fail: ;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10313
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10314
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10315
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10316
displayRectangleX:x y:y width:width height:height in:ignoredDrawableId with:aGCId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10317
    "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
 10318
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
 10319
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10320
    int w, h;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10321
    int xL, yT;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10322
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10323
     && __bothSmallInteger(x, y)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10324
     && __bothSmallInteger(width, height)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10325
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10326
	HDC hDC = _getDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10327
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10328
	xL = __intVal(x);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10329
	yT = __intVal(y);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10330
	w = __intVal(width);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10331
	h = __intVal(height);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10332
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10333
	DPRINTF(("displayRectangle: %d/%d -> %d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10334
			xL, yT, w, h));
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 10335
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10336
	if ((w >= 0) && (h >= 0)) {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10337
	    if (! GcDataGetPen(hDC,gcData)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10338
		DPRINTF(("displayRect: no pen\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10339
	    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10340
		MoveToEx(hDC, xL, yT, NULL);
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10341
#if 0
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10342
		LineTo(hDC, xL+w, yT);     // to top-right
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10343
		LineTo(hDC, xL+w, yT+h);   // to bot-right
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10344
		LineTo(hDC, xL, yT+h);     // to bot-left
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10345
		LineTo(hDC, xL, yT);       // back to top-left
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10346
#else
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10347
		LineTo(hDC, xL+w, yT);       // to top-right
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10348
		LineTo(hDC, xL+w, yT+h);     // to bot-right
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10349
		MoveToEx(hDC, xL, yT, NULL); // back to top-left
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10350
		LineTo(hDC, xL, yT+h);       // to bot-left
3976
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10351
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10352
#ifndef PRE_31_JAN_03
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10353
		LineTo(hDC, xL+w+1, yT+h);   // move pen one pixel more
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10354
#else
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10355
		LineTo(hDC, xL+w, yT+h);     // to bot-right
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10356
#endif
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10357
3976
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10358
#endif
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10359
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10360
		GcDataReleasePen(hDC, gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10361
	    }
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10362
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10363
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10364
	_releaseDC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10365
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10366
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10367
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10368
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10369
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10370
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10371
displayString:aString from:index1 to:index2 x:x y:y in:ignoredDrawableId with:aGCId opaque:opaque
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10372
    "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
 10373
     foreground and background characters.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10374
     If the coordinates are not integers, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10375
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
 10376
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10377
    unsigned char *cp;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10378
    OBJ cls;
5342
516a8f20d81d Use TextOutA to write one-byte-strings.
Stefan Vogel <sv@exept.de>
parents: 5338
diff changeset
 10379
    int i1, i2, l, n;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10380
    int nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10381
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10382
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10383
     && __isNonNilObject(aString)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10384
     && __bothSmallInteger(index1, index2)
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 10385
     && __bothSmallInteger(x, y))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10386
    {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10387
	struct gcData *gcData = _GCDATA(aGCId);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10388
	int pX, pY;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10389
	HDC hDC = _getDC(gcData);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10390
	HFONT hOldFont;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10391
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10392
	pX = __intVal(x);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10393
	pY = __intVal(y);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10394
	pY -= gcData->fontAscent;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10395
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10396
	if (opaque == true) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10397
	    if (gcData->bkMode != BK_OPAQUE) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10398
		SetBkMode(hDC, OPAQUE);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10399
		gcData->bkMode = BK_OPAQUE;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10400
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10401
	} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10402
	    if (gcData->bkMode != BK_TRANSPARENT) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10403
		SetBkMode(hDC, TRANSPARENT);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10404
		gcData->bkMode = BK_TRANSPARENT;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10405
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10406
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10407
#if 0
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10408
	/* leftover code from tries to make TextOut honor the gc-mode,
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10409
	 * until I googled, that TextOut does not (by purpose, or backward-bug compatibility)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10410
	 */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10411
	hOldFont = SelectObject(hDC, gcData->hFont);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10412
	SetTextColor(hDC, gcData->fgColor);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10413
	SetBkColor(hDC, gcData->bgColor);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10414
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10415
#if 0
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10416
	GcDataGetPen(hDC, gcData);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10417
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10418
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10419
	cls = __qClass(aString);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10420
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10421
	i1 = __intVal(index1) - 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10422
	i2 = __intVal(index2) - 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10423
	if (i1 >= 0 && i2 >= i1) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10424
	    cp = __stringVal(aString);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10425
	    l = i2 - i1 + 1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10426
	    if (l > 32758) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10427
		/* Windows (as in XP) limits the string size for TextOut* to 32758 */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10428
		l = 32758;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10429
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10430
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 10431
	    if (__isStringLike(aString)) {
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10432
		n = __stringSize(aString);
5342
516a8f20d81d Use TextOutA to write one-byte-strings.
Stefan Vogel <sv@exept.de>
parents: 5338
diff changeset
 10433
commonOutChars:
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10434
		if (i2 < n) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10435
		    cp += i1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10436
		    CPRINTF(("string1: %s pos=%d/%d l=%d hDC=%x\n", cp, pX, pY,l,hDC));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10437
		    if (! TextOutA(hDC, pX, pY, (char *)cp, l)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10438
			PRINTF(("WinWorkstation [warning]: TextOutA failed. [%d]\n", __LINE__));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10439
			PRINTF(("WinWorkstation [warning]: lastError=%d x:%d y:%d len:%d\n", GetLastError(), pX, pY, l));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10440
			goto error;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10441
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10442
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10443
		goto ret;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10444
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10445
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10446
	    nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10447
	    cp += nInstBytes;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10448
	    n = __byteArraySize(aString) - nInstBytes;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10449
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10450
	    if (__isBytes(aString)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10451
		goto commonOutChars;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10452
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10453
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10454
	    /* Unicode */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10455
	    if (__isWords(aString)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10456
		n = n / 2;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10457
		if (i2 < n) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10458
		    WIDECHAR *w_cp = (WIDECHAR *)cp;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10459
		    w_cp += i1;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10460
		    if (! TextOutW(hDC, pX, pY, w_cp, l)) {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10461
			PRINTF(("WinWorkstation [warning]: TextOutW failed. [%d]\n", __LINE__));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10462
			PRINTF(("WinWorkstation [warning]: lastError=%d x:%d y:%d len:%d\n", GetLastError(), pX, pY, l));
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10463
		    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10464
		    goto ret;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10465
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10466
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10467
	}
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 10468
ret:;
4941
f9fae1143962 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4939
diff changeset
 10469
#if 0
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10470
	GcDataReleasePen(hDC, gcData);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10471
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10472
#if 0
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10473
	SelectObject(hDC, hOldFont);
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 10474
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 10475
#ifndef CACHE_LAST_DC
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10476
	_releaseDC(gcData);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10477
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10478
    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10479
    RETURN (self);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10480
error: ;;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10481
%}.
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 10482
    self textOutFailed.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10483
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10484
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10485
drawBits:imageBits
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10486
    bitsPerPixel:bitsPerPixel
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10487
    depth:imageDepth padding:padd
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10488
    width:imageWidth height:imageHeight
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10489
    x:srcx y:srcy
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10490
    into:ignoredDrawableId
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10491
    x:dstx y:dsty
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10492
    width:w height:h
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10493
    with:aGCId
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10494
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10495
    "draw a bitImage which has depth imageDepth, width iw and height ih into
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10496
     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
 10497
     Individual source pixels have bitsPerPixel bits, allowing to draw
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10498
     depth and pixel-units to be different (in theory).
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10499
     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
 10500
     depth - otherwise, primitive failure will be signalled.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10501
     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
 10502
     colors are allocated - otherwise the colors may be wrong."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10503
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10504
    (self
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10505
	primDrawBits:imageBits
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10506
	bitsPerPixel:bitsPerPixel
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10507
	depth:imageDepth
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10508
	width:imageWidth height:imageHeight
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10509
	x:srcx y:srcy
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10510
	into:ignoredDrawableId
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10511
	x:dstx y:dsty
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10512
	width:w height:h
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10513
	with:aGCId
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10514
	parameters:(Array with:nil with:padd with:nil with:nil with:nil)
5322
bdb7b311d584 *** empty log message ***
sr
parents: 5317
diff changeset
 10515
	"/ the params array is ONLY used, because there is a 15-argument limit in st/x !!
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10516
    ) ifFalse:[
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10517
	"
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10518
	 also happens, if a segmentation violation occurs in the
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10519
	 XPutImage ...
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10520
	"
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10521
	self primitiveFailed
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10522
    ].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10523
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10524
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10525
drawBits:imageBits
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10526
    bitsPerPixel:bitsPerPixel
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10527
    depth:imageDepth
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10528
    width:imageWidth height:imageHeight
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10529
    x:srcx y:srcy
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10530
    into:ignoredDrawableId
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10531
    x:dstx y:dsty
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10532
    width:w height:h
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10533
    with:aGCId
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10534
    parameters:parameters
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10535
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10536
    "draw a bitImage which has depth id, width iw and height ih into
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10537
     the drawable. draw a region of w/h pixels from srcx/srcy to dstx/dsty.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10538
     Individual source pixels have bitsPerPixel bits, allowing to draw
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10539
     depth and pixel-units to be different (in theory).
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10540
     It has to be checked elsewhere, that the server can do it with the given
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10541
     depth - otherwise, primitive failure will be signalled.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10542
     Also it is assumed, that the colormap is setup correctly and the
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10543
     colors are allocated - otherwise the colors may be wrong."
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10544
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10545
    (self
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10546
	primDrawBits:imageBits
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10547
	bitsPerPixel:bitsPerPixel
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10548
	depth:imageDepth
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10549
	width:imageWidth height:imageHeight
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10550
	x:srcx y:srcy
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10551
	into:ignoredDrawableId
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10552
	x:dstx y:dsty
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10553
	width:w height:h
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10554
	with:aGCId
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10555
	parameters:parameters
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10556
	"/ the params array is ONLY used, because there is a 15-argument limit in st/x !!
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10557
    ) ifFalse:[
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10558
	"
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10559
	 also happens, if a segmentation violation occurs in the
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10560
	 XPutImage ...
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10561
	"
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10562
	self primitiveFailed
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10563
    ].
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10564
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10565
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10566
fillArcX:x y:y width:width height:height from:startAngle angle:angle
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10567
	       in:ignoredDrawableId with:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10568
    "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
 10569
     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
 10570
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10571
%{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10572
    int __x, __y, w, h;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10573
    float angle1, angle2;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10574
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10575
    if (__isSmallInteger(startAngle))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10576
	angle1 = (float)(__intVal(startAngle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10577
    else if (__isFloat(startAngle)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10578
	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
 10579
    } else if (__isShortFloat(startAngle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
 10580
	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
 10581
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10582
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10583
    if (__isSmallInteger(angle))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10584
	angle2 = (float)(__intVal(angle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10585
    else if (__isFloat(angle)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10586
	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
 10587
    } else if (__isShortFloat(angle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
 10588
	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
 10589
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10590
2930
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10591
    if (angle2 <= 0) {
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10592
	RETURN (self);
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10593
    }
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10594
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10595
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10596
     && __bothSmallInteger(x, y)
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 10597
     && __bothSmallInteger(width, height))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10598
     {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10599
	struct gcData *gcData = _GCDATA(aGCId);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10600
	HDC hDC;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10601
	HBRUSH hBrush;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10602
	HPEN prevPen = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10603
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10604
	w = __intVal(width);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10605
	h = __intVal(height);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10606
	__x = __intVal(x);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10607
	__y = __intVal(y);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10608
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10609
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10610
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 10611
	hBrush = GcDataGetBrush(hDC, gcData);
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 10612
	if (hBrush == 0) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10613
	    DPRINTF(("fillArc: no brush\n"));
2339
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
 10614
	} else {
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10615
	    HPEN hPen = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10616
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 10617
	    if (0 /* __isWinNT */) {
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 10618
		hPen = GcDataGetPen(hDC, gcData);
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 10619
		if (hPen == 0) {
2930
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10620
		    DPRINTF(("fillArc: no pen\n"));
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10621
		    goto failpen;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10622
		}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10623
	    } else {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10624
		prevPen = SelectObject(hDC, __nullPen);
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10625
		w++;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10626
		h++;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10627
	    }
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10628
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10629
	    {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10630
		double xB, yB, xE, yE, xR, yR;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10631
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10632
		xR = w / 2;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10633
		yR = h / 2;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10634
		if (angle2 - angle1 >= 360) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10635
		    xB = xE = __x + xR + 0.5;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10636
		    yB = yE = __y /*+ yR + 0.5*/;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10637
		} else {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10638
		    double sin(), cos();
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10639
		    float rad1, rad2;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10640
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10641
		    if (angle1 <= 180)
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10642
			angle1 = 180 - angle1;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10643
		    else
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10644
			angle1 = 360 + 180 - angle1;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10645
		    angle2 = angle1 - angle2;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10646
		    /* sigh - compute the intersections ... */
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10647
		    rad1 = (angle1 * 3.14159265359) / 180.0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10648
		    rad2 = (angle2 * 3.14159265359) / 180.0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10649
		    xB = cos(rad1) * xR;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10650
		    yB = sin(rad1) * yR;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10651
		    xE = cos(rad2) * xR;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10652
		    yE = sin(rad2) * yR;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10653
		    xB = __x + xR - xB + 0.5;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10654
		    yB = __y + yR - yB + 0.5;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10655
		    xE = __x + xR - xE + 0.5;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10656
		    yE = __y + yR - yE + 0.5;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10657
		}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10658
		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
 10659
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10660
		Pie(hDC,
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10661
		    __x, __y,
2817
3be0cda12180 fillArc off-by-one fix
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
 10662
		    __x + w + 1, __y + h + 1,
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10663
		    (int)xB, (int)yB,
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10664
		    (int)xE, (int)yE);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10665
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10666
		if (hPen) {
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10667
		    GcDataReleasePen(hDC, gcData);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10668
		}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10669
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10670
failpen:
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10671
#ifdef CACHE_LAST_CG
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10672
	    if (prevPen) SelectObject(hDC, prevPen);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10673
#endif
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10674
	    GcDataReleaseBrush(hDC, gcData);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10675
	}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10676
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10677
	_releaseDC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10678
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10679
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10680
    }
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10681
    bad: ;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10682
%}.
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10683
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10684
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10685
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10686
fillPolygon:aPolygon in:ignoredDrawableId with:aGCId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10687
    "fill a polygon given by its points.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10688
     If any coordinate is not integer, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10689
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10690
    |numberOfPoints|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10691
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10692
    numberOfPoints := aPolygon size.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10693
    self
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 10694
	primFillPolygon:aPolygon n:numberOfPoints
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10695
	in:ignoredDrawableId with:aGCId
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10696
!
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10697
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10698
fillRectangleX:x y:y width:width height:height in:ignoredDrawableId with:aGCId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10699
    "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
 10700
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
 10701
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10702
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10703
    int w, h;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10704
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10705
     && __bothSmallInteger(x, y)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10706
     && __bothSmallInteger(width, height)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10707
	w = __intVal(width);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10708
	h = __intVal(height);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10709
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10710
	if ((w >= 0) && (h >= 0)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10711
	    struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10712
	    HDC hDC;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10713
	    HBRUSH hBrush;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10714
	    RECT rct;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10715
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10716
	    hDC = _getDC(gcData);
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 10717
2663
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
 10718
	    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
 10719
	    if (! hBrush) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10720
		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
 10721
	    } else {
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10722
		rct.left = __intVal(x);
3976
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10723
		rct.top  = __intVal(y);
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10724
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10725
#ifndef PRE_31_JAN_03
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10726
		rct.right  = rct.left + w;
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10727
		rct.bottom = rct.top  + h;
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10728
#else
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10729
		rct.right  = rct.left + w + 1;    /* definitiv ! */
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10730
		rct.bottom = rct.top  + h + 1;
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10731
#endif
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10732
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10733
		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
 10734
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 10735
		/*
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 10736
		 * for solid draws (without function), can use FillRect,
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 10737
		 * which is faster and does not need a pen.
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 10738
		 */
2663
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
 10739
		if ((gcData->rop2 == R2_COPYPEN)
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
 10740
		 && (gcData->bitbltrop2 == BITBLT_COPY)) {
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 10741
		    AQUIRE_DRAW_MUTEX
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 10742
		    FillRect(hDC, &rct, hBrush);
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 10743
		    RELEASE_DRAW_MUTEX
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10744
		    GcDataReleaseBrush(hDC, gcData);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 10745
		} else {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10746
		    HPEN prevPen;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10747
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10748
		    prevPen = SelectObject(hDC, __nullPen);
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
 10749
/* sigh - conflict between ST/X's Rectangle and Win32's Rectangle */
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
 10750
# undef Rectangle
3976
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10751
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10752
#ifndef PRE_31_JAN_03
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10753
		    Rectangle(hDC, rct.left, rct.top, rct.right +1, rct.bottom +1);
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10754
#else
2663
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
 10755
		    Rectangle(hDC, rct.left, rct.top, rct.right, rct.bottom);
3976
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10756
#endif
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10757
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
 10758
# define Rectangle __DEF_Rectangle
2663
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
 10759
		    GcDataReleaseBrush(hDC, gcData);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10760
#ifdef CACHE_LAST_DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10761
		    SelectObject(hDC, prevPen);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10762
#endif
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 10763
		}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10764
	    }
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10765
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10766
	    _releaseDC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10767
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10768
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10769
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10770
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10771
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10772
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10773
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10774
primDrawBits:imageBits
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10775
	bitsPerPixel:bitsPerPixel depth:imageDepth
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10776
	width:imageWidth height:imageHeight
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10777
	x:srcx y:srcy
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10778
	into:ignoredDrawableId
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10779
	x:dstx y:dsty
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10780
	width:w height:h
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10781
	with:aGCId
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10782
	parameters:params
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10783
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10784
    |sourceAlphaOrNil padd redMask greenMask blueMask|
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10785
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10786
    "/ the params array is ONLY used, because there is a 15-argument limit in st/x
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10787
    sourceAlphaOrNil := params at:1.
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10788
    padd := params at:2.
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10789
    redMask := params at:3.
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10790
    greenMask := params at:4.
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10791
    blueMask := params at:5.
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10792
%{
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10793
    unsigned char fastBits[10000];
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10794
    unsigned char *b_bits = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10795
    unsigned char *allocatedBits = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10796
    struct gcData *gcData = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10797
    HDC hDC = (HDC)0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10798
    unsigned char *__imageBits = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10799
    int _sourceAlpha = 0;
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10800
    int _doAlphaBlend = 0;
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10801
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10802
    if (__isByteArray(imageBits)) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10803
	__imageBits = __ByteArrayInstPtr(imageBits)->ba_element;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10804
    } else if (__isExternalBytesLike(imageBits)) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10805
	__imageBits = (unsigned char *)(__externalBytesAddress(imageBits));
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10806
    }
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10807
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10808
    if (ISCONNECTED
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10809
     && __isExternalAddress(aGCId)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10810
     && __bothSmallInteger(srcx, srcy)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10811
     && __bothSmallInteger(dstx, dsty)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10812
     && __bothSmallInteger(w, h)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10813
     && __bothSmallInteger(imageWidth, imageHeight)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10814
     && __bothSmallInteger(imageDepth, bitsPerPixel)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10815
     && __isSmallInteger(padd)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10816
     && __imageBits)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10817
     {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10818
	struct
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10819
	{
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10820
	  BITMAPINFOHEADER bmiHeader;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10821
	  DWORD r;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10822
	  DWORD g;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10823
	  DWORD b;
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10824
	  DWORD a;
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10825
	} bitmap;
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10826
	int _padd = __intVal(padd);
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10827
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10828
	gcData = _GCDATA(aGCId);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10829
	if (! gcData )
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10830
	    goto fail;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10831
	hDC = _getDC(gcData);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10832
	DDPRINTF(("hDC = %x\n", hDC));
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10833
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10834
	if (_padd != WIN32PADDING) {
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10835
	    int row, col;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10836
	    unsigned char *cp;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10837
	    unsigned char *pBits;
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10838
	    int b_width, b_height, bytesPerRowST, bytesPerRowWIN, padding, nBytes;
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10839
	    int bi = __intVal(bitsPerPixel);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10840
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10841
	    b_width = __intVal(imageWidth);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10842
	    b_height = __intVal(imageHeight);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10843
	    bytesPerRowST = (b_width * bi + (_padd-1)) / _padd;
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10844
	    bytesPerRowWIN = (b_width * bi + (WIN32PADDING-1)) / WIN32PADDING * (WIN32PADDING/8);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10845
	    padding = bytesPerRowWIN - bytesPerRowST;
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10846
	    /* console_printf("padd %d bs %d bw %d p %d\n",_padd,bytesPerRowST,bytesPerRowWN,padding); */
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10847
	    if (padding) {
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10848
		nBytes = b_height * bytesPerRowWIN;
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10849
		if (nBytes < sizeof(fastBits)) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10850
		    cp = b_bits = fastBits;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10851
		} else {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10852
		    cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10853
		}
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10854
		if (cp) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10855
		    pBits = __imageBits;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10856
		    for (row = b_height; row; row--) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10857
			for (col = bytesPerRowST; col; col--) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10858
			    *cp++ = *pBits++;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10859
			}
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10860
			cp += padding;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10861
		    }
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10862
		} else
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10863
		    goto fail;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10864
	    }
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10865
	}
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10866
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10867
	if (b_bits == 0) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10868
	    b_bits = __imageBits;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10869
	}
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10870
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10871
	bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10872
	bitmap.bmiHeader.biPlanes = 1;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10873
	switch (__intVal(imageDepth)) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10874
	    case 16:
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10875
		/* notice the default r/g/b (STX order here) */
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10876
#if 1
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10877
		bitmap.bmiHeader.biCompression = BI_BITFIELDS;
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10878
		bitmap.r = redMask == nil ? 0xf800 : __intVal(redMask);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10879
		bitmap.g = greenMask == nil ? 0x07e0 : __intVal(greenMask);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10880
		bitmap.b = blueMask == nil ? 0x001f : __intVal(blueMask);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10881
#endif
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10882
		break;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10883
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10884
	    case 24:
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10885
		/* notice the default b/g/r (WIN32 order here) */
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10886
#if 0
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10887
		bitmap.bmiHeader.biCompression = BI_BITFIELDS;
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10888
		bitmap.r = redMask == nil ? 0xff0000 : __intVal(redMask);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10889
		bitmap.g = greenMask == nil ? 0x00ff00 : __intVal(greenMask);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10890
		bitmap.b = blueMask == nil ? 0x0000ff : __intVal(blueMask);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10891
#endif
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10892
		bitmap.bmiHeader.biCompression = BI_RGB;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10893
		break;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10894
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10895
	    case 32:
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10896
		/* notice the default r/g/b (STX order here) */
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10897
		bitmap.bmiHeader.biCompression = BI_RGB;
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10898
#if 1
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10899
		bitmap.bmiHeader.biCompression = BI_BITFIELDS;
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10900
		bitmap.r = redMask == nil ? 0x0000ff : __intVal(redMask);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10901
		bitmap.g = greenMask == nil ? 0x00ff00 : __intVal(greenMask);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10902
		bitmap.b = blueMask == nil ? 0xff0000 : __intVal(blueMask);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10903
		bitmap.a = 0xff000000;
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10904
#endif
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10905
		break;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10906
	}
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10907
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10908
	if (sourceAlphaOrNil != nil) {
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10909
console_printf("sourceAlphaOrNil = %x\n", sourceAlphaOrNil);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10910
	    _sourceAlpha = __intVal(sourceAlphaOrNil);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10911
	    _doAlphaBlend = 1;
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10912
	}
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 10913
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10914
	bitmap.bmiHeader.biSizeImage = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10915
	bitmap.bmiHeader.biXPelsPerMeter = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10916
	bitmap.bmiHeader.biYPelsPerMeter = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10917
	bitmap.bmiHeader.biClrUsed = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10918
	bitmap.bmiHeader.biClrImportant = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10919
	bitmap.bmiHeader.biWidth = __intVal(imageWidth);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10920
	bitmap.bmiHeader.biHeight = -(__intVal(imageHeight));
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10921
	bitmap.bmiHeader.biBitCount = __intVal(bitsPerPixel);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10922
	/*console_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);*/
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10923
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10924
	if (! _doAlphaBlend) {
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10925
	    SetDIBitsToDevice(hDC,
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10926
				__intVal(dstx), __intVal(dsty),
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10927
				__intVal(w), __intVal(h),
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10928
				__intVal(srcx), __intVal(srcy),
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10929
				0, __intVal(h),
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10930
				(void *)b_bits,
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10931
				(BITMAPINFO*)&bitmap,
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10932
				DIB_RGB_COLORS);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10933
	} else {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10934
	    HDC ahdc;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10935
	    HBITMAP ahbitmap;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10936
	    void *pvBits;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10937
	    BLENDFUNCTION bf;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10938
	    static BOOL (__stdcall *P_AlphaBlend)(HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION );
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10939
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10940
	    if (P_AlphaBlend == 0) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10941
		/* as I dont have AlphaBlend in the inport32.lib (bcc sucks),
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10942
		 * fetch its address dynamically...
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10943
		 */
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10944
		HINSTANCE hWinGDI = LoadLibrary("msimg32.dll");
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10945
		if (hWinGDI) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10946
		    P_AlphaBlend = (BOOL (__stdcall *)(HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION ))
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10947
					GetProcAddress(hWinGDI, "AlphaBlend");
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10948
		}
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10949
	    }
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10950
	    if (P_AlphaBlend != 0) {
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10951
console_printf("***********************************\n");
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10952
console_printf("_sourceAlpha = %d\n", _sourceAlpha);
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10953
		ahdc = CreateCompatibleDC(hDC);
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10954
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10955
		ahbitmap = CreateCompatibleBitmap(hDC, __intVal(imageWidth), __intVal(imageHeight));
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10956
		SelectObject(ahdc, ahbitmap);
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10957
		SetDIBitsToDevice(ahdc,
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10958
				0, 0,    /* dstx, dsty */
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10959
				__intVal(imageWidth), __intVal(imageHeight),
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10960
				__intVal(srcx), __intVal(srcy),
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10961
				0, __intVal(imageHeight),
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10962
				(void *)b_bits,
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10963
				(BITMAPINFO*)&bitmap,
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10964
				DIB_RGB_COLORS);
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10965
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10966
		bf.BlendOp = AC_SRC_OVER;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10967
		bf.BlendFlags = 0;
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10968
		bf.SourceConstantAlpha = _sourceAlpha;
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10969
		bf.AlphaFormat = AC_SRC_ALPHA;
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10970
#if 1
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10971
		(*P_AlphaBlend) (hDC,
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10972
				__intVal(dstx), __intVal(dsty),
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10973
				__intVal(imageWidth), __intVal(imageHeight),
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10974
				ahdc,
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10975
				0, 0,     /* srcx, srcy */
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10976
				__intVal(imageWidth), __intVal(imageHeight),
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10977
				bf);
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10978
#else
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10979
		bf.SourceConstantAlpha = 255-_sourceAlpha;
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10980
		bf.AlphaFormat = 0;
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10981
		bf.BlendOp = 0;
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10982
		(*P_AlphaBlend) (ahdc,
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10983
				0, 0,     /* dstx, dsty */
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10984
				__intVal(imageWidth), __intVal(imageHeight),
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10985
				hDC,
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10986
				__intVal(dstx), __intVal(dsty),   /* srcx, srcy */
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10987
				__intVal(imageWidth), __intVal(imageHeight),
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10988
				bf);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10989
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10990
		BitBlt (hDC,
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10991
				__intVal(dstx), __intVal(dsty),
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10992
				__intVal(imageWidth), __intVal(imageHeight),
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10993
				ahdc,
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10994
				0, 0,   /* srcx, srcy */
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10995
				SRCCOPY);
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10996
#endif
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10997
		DeleteObject(ahbitmap);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10998
		DeleteDC(ahdc);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 10999
	    }
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11000
	}
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11001
	if (allocatedBits) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11002
	    free(allocatedBits);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11003
	}
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11004
#ifndef CACHE_LAST_DC
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11005
	_releaseDC(gcData);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11006
#endif
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11007
	RETURN ( true );
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11008
    }
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11009
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11010
fail: ;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11011
    PRINTF(("create temp bitmap FAILED!!!\n"));
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11012
    if (allocatedBits) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11013
	PRINTF(("freeing up temp bitmap bits ...\n"));
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11014
	free(allocatedBits);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11015
    }
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11016
#ifndef CACHE_LAST_DC
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11017
    if (hDC) {
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11018
	_releaseDC(gcData);
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11019
    }
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11020
#endif
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11021
%}
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11022
.
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11023
    ^ false
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11024
!
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11025
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 11026
primFillPolygon:aPolygon n:numberOfPoints in:ignoredDrawableId with:aGCId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11027
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 11028
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11029
    OBJ point, px, py;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11030
    int i, num;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11031
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11032
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11033
     && __isSmallInteger(numberOfPoints)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11034
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11035
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11036
	POINT p;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 11037
	HBRUSH hBrush;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11038
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11039
	num = __intVal(numberOfPoints);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11040
	if (num < 3) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11041
	    RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11042
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11043
	for (i=0; i<num; i++) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11044
	    point = __AT_(aPolygon, __MKSMALLINT(i+1));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11045
	    if (! __isPoint(point)) goto fail;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11046
	    px = _point_X(point);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11047
	    py = _point_Y(point);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11048
	    if (! __bothSmallInteger(px, py))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11049
		goto fail;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11050
	}
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11051
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11052
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11053
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 11054
	hBrush = GcDataGetBrush(hDC,gcData);
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 11055
	if (hBrush == 0) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11056
	    DPRINTF(("fillPolygon: no brush\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11057
	} else {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11058
	    HPEN prevPen;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11059
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11060
	    prevPen = SelectObject(hDC, __nullPen);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11061
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11062
	    BeginPath(hDC);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11063
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11064
	    for (i=0; i<num; i++) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11065
		point = __AT_(aPolygon, __MKSMALLINT(i+1));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11066
		px = _point_X(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11067
		py = _point_Y(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11068
		if (i == 0) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11069
		    MoveToEx(hDC, __intVal(px), __intVal(py), NULL);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11070
		} else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11071
		    if (i == (num-1)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11072
			p.x = __intVal(px);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11073
			p.y = __intVal(py);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11074
			PolylineTo(hDC, &p, 1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11075
		    } else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11076
			LineTo(hDC, __intVal(px), __intVal(py));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11077
		    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11078
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11079
	    }
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11080
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11081
	    EndPath(hDC);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11082
	    FillPath(hDC);
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 11083
	    GcDataReleaseBrush(hDC, gcData);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11084
#ifdef CACHE_LAST_DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11085
	    SelectObject(hDC, prevPen);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11086
#endif
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 11087
	}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 11088
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11089
	_releaseDC(gcData);
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 11090
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11091
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11092
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11093
fail: ;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11094
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11095
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11096
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11097
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11098
!WinWorkstation methodsFor:'event forwarding'!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11099
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11100
activate:aBoolean view:aView
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11101
    "some view was activated/deactivated.
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11102
     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
 11103
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11104
    aBoolean ifFalse:[
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11105
	activeView := nil.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11106
	self focusOutView:aView.
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11107
    ] ifTrue:[
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11108
	activeView := aView.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11109
	self focusInView:aView.
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11110
    ].
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11111
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11112
    "Created: / 28.4.1999 / 14:51:51 / cg"
2599
9c0749ee47ed #activate:view: via sensor
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
 11113
    "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
 11114
!
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11115
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11116
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
 11117
    "forward a configure for some view"
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11118
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11119
    aView realized ifTrue:[
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11120
	super configureX:x y:y width:w height:h view:aView
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11121
    ]
4577
3df3646d702f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4576
diff changeset
 11122
3df3646d702f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4576
diff changeset
 11123
    "Modified: / 08-09-2006 / 19:40:18 / cg"
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11124
!
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11125
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11126
copyDataEvent:parameter eventData:dataBytes view:aView
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11127
    "forward a copyData event for some view as a client message"
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11128
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11129
    aView isNil ifTrue:[
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11130
	"/ event arrived, after I destroyed it myself
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11131
	^ self
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11132
    ].
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11133
    aView sensor
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11134
	copyDataEvent:parameter
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11135
	eventData:dataBytes
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11136
	view:aView
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11137
!
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11138
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11139
displayChange
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11140
    "the display metrics/settings have changed.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11141
     This is a speciality of windows.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11142
     TODO: Tell the viewStyle to update itself,
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11143
	   and tell all views to reinit their style.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11144
     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
 11145
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11146
    self initializeVariableScreenProperties.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11147
!
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11148
4457
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11149
dropFiles:files view:view position:dropPosition handle:dropHandle
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11150
    "called when files are dropped from windows.
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11151
     The dropHandle is required to free Win32 data (and to remove the drop-file)
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11152
     eventually"
4455
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11153
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11154
"/    Transcript showCR:'Drop files:'.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11155
"/    Transcript show:'  View:'; showCR:view.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11156
"/    Transcript show:'  Position:'; showCR:dropPosition.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11157
"/    Transcript showCR:'  Files:'.
4457
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11158
"/    files do:[:f|
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11159
"/        Transcript showCR:('    ', f printString)
4455
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11160
"/    ].
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11161
"/
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11162
    view isNil ifTrue:[
4457
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11163
	"/ event arrived, after I destroyed it myself
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11164
	^ self
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11165
    ].
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11166
    view sensor
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11167
	dropFiles:files view:view position:dropPosition handle:dropHandle
4455
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11168
!
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11169
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11170
fontChange
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11171
    "the system fonts (users preferences) have changed.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11172
     This is a speciality of windows.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11173
     TODO: Tell the viewStyle to update itself,
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 11174
	   and tell all views to reinit their style.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11175
     For now,this is ignored."
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11176
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11177
    IgnoreFontChanges ~~ true ifTrue:[
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 11178
"/        'WinWorkstation [info]: fontChange ignored for now.' infoPrintCR
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11179
    ]
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 11180
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 11181
    "Modified: / 19.5.1999 / 23:37:17 / cg"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11182
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11183
5207
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11184
mouseWheelMotion:buttonState x:x y:y amount:amount deltaTime:dTime view:aView
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11185
    "the mousewheel event as delivered by win32 has a bug:
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11186
     the view passed here is always the topView - not the view under the pointer.
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11187
     For compatibility with unix, we figure out the view here and pass that one down."
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11188
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11189
    |focusView|
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11190
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11191
    aView isNil ifTrue:[
5230
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
 11192
	"/ event arrived, after I destroyed it myself
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
 11193
	^ self
5207
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11194
    ].
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11195
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11196
    aView windowGroup notNil ifTrue:[
5230
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
 11197
	focusView := aView windowGroup focusView.
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
 11198
    ].
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
 11199
    aView sensor
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
 11200
	mouseWheelMotion:buttonState x:x y:y amount:amount deltaTime:dTime
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
 11201
	view:(focusView ? aView)
5207
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11202
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11203
    "Modified: / 21.5.1999 / 13:05:53 / cg"
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11204
!
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11205
4230
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11206
nativeWidgetCommand:commandId view:aView
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11207
    "forward a command event for some view.
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11208
     (Button, CheckBox etc.)"
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11209
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11210
    |sensor|
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11211
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11212
    aView isNil ifTrue:[
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11213
	"/ event arrived, after I destroyed it myself
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11214
	^ self
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11215
    ].
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11216
    sensor := aView sensor.
4249
af3c0e138c8a *** empty log message ***
ca
parents: 4248
diff changeset
 11217
    sensor
af3c0e138c8a *** empty log message ***
ca
parents: 4248
diff changeset
 11218
	nativeWidgetCommand:#'win32nativeWMCommand:'
af3c0e138c8a *** empty log message ***
ca
parents: 4248
diff changeset
 11219
	arguments:(Array with:commandId)
af3c0e138c8a *** empty log message ***
ca
parents: 4248
diff changeset
 11220
	view:aView
4230
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11221
!
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11222
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11223
queryEndSession
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11224
    "system is about to be shut down.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11225
     This is a speciality of windows.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11226
     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
 11227
     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
 11228
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 11229
    '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
 11230
    ^ true
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11231
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11232
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11233
settingsChange
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11234
    "some system settings (users preferences) have changed.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11235
     This is a speciality of windows.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11236
     For now, only a few attributes are reinitialized."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11237
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11238
    self initializeVariableSettingsProperties.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11239
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11240
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 11241
systemColorChange:aWindow
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11242
    "the system colors (users preferences) have changed.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11243
     This is a speciality of windows.
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11244
     Tell the viewStyle to update itself,
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11245
     and tell all view to reinit its style."
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 11246
2682
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
 11247
    |anyChange|
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
 11248
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11249
    IgnoreSysColorChanges ~~ true ifTrue:[
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11250
	"/ first check, if there was really a change
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11251
	"/ (when exceed is running, we get plenty of those messages ...)
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11252
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11253
	SystemColorValues isNil ifTrue:[
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11254
	    SystemColorValues := IdentityDictionary new.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11255
	].
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11256
	anyChange := false.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11257
	self supportedSystemColorKeys do:[:key |
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11258
	    |oldValue newValue|
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11259
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11260
	    oldValue := SystemColorValues at:key ifAbsent:nil.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11261
	    newValue := self getSystemColor:key.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11262
	    oldValue ~= newValue ifTrue:[
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11263
		SystemColorValues at:key put:newValue.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11264
		anyChange := true.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11265
	    ]
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11266
	].
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11267
	anyChange ifTrue:[
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11268
	    "/ TODO: this should go through the sensor ...
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11269
	    "/ ...and be handled as an event by the views thread.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11270
	    SimpleView readStyleSheetAndUpdateAllStyleCaches.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11271
	    aWindow withAllSubViewsDo:[:aView |
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11272
		aView reinitStyle
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11273
	    ]
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11274
	]
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 11275
    ]
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 11276
4577
3df3646d702f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4576
diff changeset
 11277
    "Modified: / 08-09-2006 / 19:39:20 / cg"
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11278
!
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11279
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11280
trayAction:eventCode view:aView
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 11281
    "forward a tray event for some view."
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11282
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11283
    |sensor message arg|
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11284
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11285
    aView isNil ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11286
	"/ event arrived, after I destroyed it myself
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11287
	^ self
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11288
    ].
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11289
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11290
    eventCode == 512 "WM_MOUSEMOVE" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11291
	"/ mouse motion
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11292
	message := #trayMouseMotion
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11293
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11294
    eventCode == 513 "WM_LBUTTONDOWN" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11295
	"/ left-button-press
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11296
	message := #trayButtonPress:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11297
	arg := 1.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11298
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11299
    eventCode == 514 "WM_LBUTTONUP" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11300
	"/ left-button-release
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11301
	message := #trayButtonRelease:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11302
	arg := 1.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11303
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11304
    eventCode == 515 "WM_LBUTTONDBLCLK" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11305
	"/ left-button-double-click
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11306
	message := #trayButtonDoubleClick:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11307
	arg := 1.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11308
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11309
    eventCode == 516 "WM_RBUTTONDOWN" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11310
	"/ right-button-press
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11311
	message := #trayButtonPress:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11312
	arg := 3.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11313
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11314
    eventCode == 517 "WM_RBUTTONUP" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11315
	"/ right-button-release
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11316
	message := #trayButtonRelease:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11317
	arg := 3.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11318
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11319
    eventCode == 518 "WM_RBUTTONDBLCLK" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11320
	"/ left-button-double-click
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11321
	message := #trayButtonDoubleClick:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11322
	arg := 3.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11323
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11324
    eventCode == 519 "WM_MBUTTONDOWN" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11325
	"/ middle-button-press
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11326
	message := #trayButtonPress:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11327
	arg := 2.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11328
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11329
    eventCode == 520 "WM_MBUTTONUP" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11330
	"/ middle-button-release
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11331
	message := #trayButtonRelease:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11332
	arg := 2.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11333
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11334
    eventCode == 521 "WM_MBUTTONDBLCLK" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11335
	"/ middle-button-double-click
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11336
	message := #trayButtonDoubleClick:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11337
	arg := 2.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11338
    ].
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11339
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11340
    message isNil ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11341
	Transcript showCR:eventCode.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11342
	^ self.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11343
    ].
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11344
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11345
    sensor := aView sensor.
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11346
    sensor
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11347
	trayAction:message
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11348
	arguments:(Array with:arg)
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11349
	view:aView
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11350
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11351
    "Created: / 31-10-2007 / 00:13:31 / cg"
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 11352
    "Modified: / 05-11-2007 / 12:14:28 / cg"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11353
! !
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11354
4236
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11355
!WinWorkstation methodsFor:'event forwarding-native'!
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11356
4239
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 11357
win32NativeScroll:scrollCode position:newPos view:aScrollBar
4236
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11358
    "native scrollbar widget event."
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11359
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11360
    aScrollBar isNil ifTrue:[
4237
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 11361
	"/ event arrived, after I destroyed it myself
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 11362
	^ self
4236
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11363
    ].
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11364
4248
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11365
    self class debugNative ifTrue:[
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11366
	'WinWorkstation [info]: native scroll event' infoPrint.
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11367
	    ' code=' infoPrint.
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11368
	    scrollCode infoPrint.
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11369
	    ' position=' infoPrint.
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11370
	    newPos infoPrintCR.
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11371
    ].
4237
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 11372
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 11373
    aScrollBar sensor
4239
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 11374
	nativeWidgetCommand:#win32NativeScroll:position:
4237
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 11375
	arguments:(Array with:scrollCode with:newPos) view:aScrollBar
4236
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11376
! !
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11377
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11378
!WinWorkstation methodsFor:'event handling'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11379
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11380
dispatchEventFor:aViewIdOrNil withMask:eventMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11381
    "central event handling method:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11382
     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
 11383
     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
 11384
     otherwise only events for the view with given id are processed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11385
     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
 11386
     handled.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11387
     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
 11388
	      pending event before calling this."
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11389
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11390
    (self getEventFor:aViewIdOrNil withMask:eventMask) ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11391
	AbortSignal handle:[:ex |
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11392
	    ex return
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11393
	] do:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11394
	    self dispatchLastEvent.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11395
	]
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11396
    ].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11397
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11398
    "Modified: 19.8.1997 / 17:10:42 / cg"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11399
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11400
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11401
dispatchExposeEventFor:aViewIdOrNil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11402
    "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
 11403
     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
 11404
     otherwise only events for the view with given id are processed."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11405
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11406
    self dispatchEventFor:aViewIdOrNil withMask:(self eventMaskFor:#expose)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11407
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11408
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11409
dispatchLastEvent
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11410
    |theView symS arg butt sibling windowID siblingID propertyID selectionID targetID requestorID
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11411
     eventType|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11412
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11413
%{  /* xxSTACK: 8000 */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11414
    struct queuedEvent *ev = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11415
    struct queuedEvent _ev_buf;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11416
    struct inlineCache *ipS;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11417
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11418
    static struct inlineCache vid = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11419
    static struct inlineCache conf = _ILC5;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11420
    static struct inlineCache skp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11421
    static struct inlineCache skr = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11422
    static struct inlineCache exp = _ILC5;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11423
    static struct inlineCache gexpS = _ILC6;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11424
    static struct inlineCache nexpS = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11425
    static struct inlineCache clr = _ILC5;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11426
    static struct inlineCache bp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11427
    static struct inlineCache br = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11428
    static struct inlineCache bmp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11429
    static struct inlineCache bsp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11430
    static struct inlineCache mot = _ILC4;
2733
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
 11431
    static struct inlineCache mwh = _ILC6;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11432
    static struct inlineCache unmap = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11433
    static struct inlineCache map = _ILC1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11434
    static struct inlineCache termS = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11435
    static struct inlineCache destr = _ILC1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11436
    static struct inlineCache setCurs = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11437
    static struct inlineCache focOut = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11438
    static struct inlineCache focIn = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11439
    static struct inlineCache act = _ILC2;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11440
    static struct inlineCache pe = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11441
    static struct inlineCache pl = _ILC2;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11442
    static struct inlineCache vis = _ILC1;
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
 11443
    static struct inlineCache sysClrChg = _ILC1;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11444
    static struct inlineCache fontChg = _ILC0;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 11445
    static struct inlineCache settingChg = _ILC0;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11446
    static struct inlineCache qEndSess = _ILC0;
4832
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 11447
    static struct inlineCache power = _ILC0;
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 11448
    static struct inlineCache quit = _ILC0;
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
 11449
    static struct inlineCache command = _ILC2;
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11450
    static struct inlineCache trayMessage = _ILC2;
4239
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 11451
    static struct inlineCache win32NativeScroll = _ILC3;
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
 11452
    static struct inlineCache win32DrawItem = _ILC2;
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11453
    static struct inlineCache copyData = _ILC3;
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
 11454
4457
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11455
    static struct inlineCache dropFiles = _ILC4;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11456
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11457
    int x, y, w, h;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11458
    int keyCode, modifiers, isDoubleClick = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11459
    int isDown = 1;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11460
    int state, dir;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11461
    OBJ upDown;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11462
    OBJ eB;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11463
    char nameBuffer[100];
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11464
    HWND hWnd = 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11465
    DDPRINTF(("dispatchLast\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11466
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11467
    eB = __INST(eventBuffer);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11468
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11469
    if (__isByteArray(eB)) {
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11470
	ev = (struct queuedEvent *)(__ByteArrayInstPtr(eB)->ba_element);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11471
    } else {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 11472
	console_fprintf(stderr, "WinWorkstation [error]: no eventBuffer\n");
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11473
	RETURN (false);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11474
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 11475
    if (ev) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 11476
	_ev_buf = *ev;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 11477
	ev = &_ev_buf;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11478
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11479
    hWnd = ev->ev_hWnd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11480
    if (!(hWnd /*&& IsWindow(hWnd)*/)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11481
	DPRINTF(("wrong hWnd in event in dispatchLastEvent\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11482
	RETURN (false);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11483
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11484
    {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11485
	OBJ t;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11486
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11487
	/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11488
	 * 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
 11489
	 * avoid creation & lookup then.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11490
	 */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11491
#if 1
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11492
	if ((t = __INST(lastId)) != nil) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11493
	    if (__isExternalAddress(t)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11494
		if (_HWNDVal(t) == hWnd) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11495
		    theView = __INST(lastView);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11496
		    if (__isNonNilObject(theView)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11497
			if (__qClass(theView) == nil) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11498
			    theView = nil;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11499
			}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11500
		    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11501
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11502
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11503
	}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11504
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11505
	if (theView == nil) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11506
	    windowID = __MKOBJ(ev->ev_hWnd);
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11507
	    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
 11508
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11509
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11510
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11511
    if (theView == nil) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 11512
	DPRINTF(("nil view [hWnd=%x msg=0x%x] in dispatchEvent\n",
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11513
		 ev->ev_hWnd, ev->ev_message));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11514
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11515
	RETURN (false);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11516
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11517
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11518
    switch (ev->ev_message) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11519
	    case WM_WINDOWPOSCHANGED:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11520
		{
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
 11521
		    RECT rct;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
 11522
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
 11523
		    x = ev->ev_x;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
 11524
		    y = ev->ev_y;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
 11525
		    w = ev->ev_w;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
 11526
		    h = ev->ev_h;
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
 11527
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11528
		    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
 11529
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
 11530
		    (*conf.ilc_func)(self,
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11531
				     @symbol(configureX:y:width:height:view:),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11532
				     nil, &conf,
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11533
				     __MKSMALLINT(x),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11534
				     __MKSMALLINT(y),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11535
				     __MKSMALLINT(w),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11536
				     __MKSMALLINT(h),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11537
				     theView);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11538
		}
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11539
		break;
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
 11540
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 11541
	    case WM_DROPFILES:
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 11542
		{
4457
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11543
		    HDROP hDrop = (HDROP) ev->ev_wParam;
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11544
		    int   count = DragQueryFile( hDrop,0xffffffff,0,0 );
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11545
5230
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
 11546
		    DPRINTFIF(__debug_WM_DROPFILES__ , ("count=%d hDrop=%x\n", count, hDrop));
4457
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11547
		    if (count > 0) {
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11548
			OBJ  dropHandle, files, position;
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11549
			char buf[MAXPATH];
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11550
			int  i;
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11551
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11552
			dropHandle = __MKOBJ(hDrop);
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11553
			__PROTECT__(dropHandle);
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11554
			files = __ARRAY_NEW_INT( count );
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11555
			__UNPROTECT__(dropHandle);
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11556
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11557
			for (i = 0;i < count;i++) {
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11558
			    OBJ s;
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11559
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11560
			    DragQueryFile(hDrop,i,buf,sizeof(buf));
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11561
			    __PROTECT__(dropHandle);
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11562
			    __PROTECT__(files);
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11563
			    __PROTECT__(theView);
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11564
			    s = __MKSTRING(buf);
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11565
			    __UNPROTECT__(theView);
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11566
			    __UNPROTECT__(files);
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11567
			    __UNPROTECT__(dropHandle);
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11568
			    __ArrayInstPtr(files)->a_element[i] = s; __STORE(files, s);
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11569
			}
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11570
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11571
			{
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11572
			    POINT pos;
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11573
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11574
			    DragQueryPoint(hDrop, &pos);
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11575
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11576
			    __PROTECT__(dropHandle);
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11577
			    __PROTECT__(files);
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11578
			    __PROTECT__(theView);
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11579
			    position = __MKPOINT_INT(pos.x, pos.y);
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11580
			    __UNPROTECT__(theView);
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11581
			    __UNPROTECT__(files);
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11582
			    __UNPROTECT__(dropHandle);
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11583
			}
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11584
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11585
			(*dropFiles.ilc_func)
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11586
			    ( self
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11587
			      , @symbol(dropFiles:view:position:handle:)
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11588
			      , nil, &dropFiles,
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11589
			      files, theView, position, dropHandle
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11590
			    );
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
 11591
		    }
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 11592
		}
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 11593
		break;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 11594
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11595
	    case WM_SHOWWINDOW:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11596
		if (ev->ev_wParam == TRUE) {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11597
		    DPRINTF((">>> WM_SHOWWINDOW -> mappedView:\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11598
		    arg = @symbol(unobscured);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 11599
		    (*vis.ilc_func)(theView,
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 11600
				    @symbol(visibilityChange:),
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11601
				    nil, &vis, arg);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11602
		    (*map.ilc_func)(self,
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11603
				    @symbol(mappedView:),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11604
				    nil, &map, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11605
		} else {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11606
		    DPRINTF((">>> WM_SHOWWINDOW -> unMappedView:\n"));
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11607
#if 0
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11608
		    arg = @symbol(fullyObscured);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 11609
		    (*vis.ilc_func)(theView,
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 11610
				    @symbol(visibilityChange:),
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11611
				    nil, &vis, arg);
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11612
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11613
		    (*unmap.ilc_func)(self,
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11614
				      @symbol(unmappedView:),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11615
				      nil, &unmap, theView);
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11616
		}
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11617
		break;
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11618
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11619
	    case __WM_ICONIFIED:
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11620
		if (ev->ev_wParam) {
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11621
		    DPRINTF((">>> __WM_ICONIFIED -> unMappedView:\n"));
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11622
#if 0
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11623
		    arg = @symbol(fullyObscured);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 11624
		    (*vis.ilc_func)(theView,
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 11625
				    @symbol(visibilityChange:),
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11626
				    nil, &vis, arg);
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11627
#endif
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11628
		    (*unmap.ilc_func)(self,
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11629
				      @symbol(unmappedView:),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11630
				      nil, &unmap, theView);
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11631
		} else {
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11632
		    DPRINTF((">>> __WM_DEICONIFIED -> mappedView:\n"));
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11633
		    arg = @symbol(unobscured);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 11634
		    (*vis.ilc_func)(theView,
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 11635
				    @symbol(visibilityChange:),
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11636
				    nil, &vis, arg);
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11637
		    (*map.ilc_func)(self,
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11638
				    @symbol(mappedView:),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11639
				    nil, &map, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11640
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11641
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11642
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11643
	    case WM_CLOSE:
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11644
		DPRINTF((">>> WM_CLOSE -> terminateView:\n"));
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11645
		(*termS.ilc_func)(self,
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 11646
				  @symbol(terminateView:),
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11647
				  nil, &termS, theView);
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11648
		break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11649
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11650
	    case WM_DESTROY:
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11651
		DPRINTF((">>> WM_DESTROY -> destroyedView\n"));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11652
		(*destr.ilc_func)(self,
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11653
				  @symbol(destroyedView:),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11654
				  nil, &destr, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11655
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11656
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11657
	    case WM_ACTIVATE:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11658
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11659
		switch (LOWORD(ev->ev_wParam)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11660
		    case WA_INACTIVE:
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11661
			DPRINTF((">>> WM_ACTIVATE inactive h=%x\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11662
			(*act.ilc_func)(self,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11663
					@symbol(activate:view:),
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11664
					nil, &act,
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11665
					false, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11666
			break;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11667
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11668
		    case WA_ACTIVE:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11669
		    case WA_CLICKACTIVE:
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11670
			DPRINTF((">>> WM_ACTIVATE active h=%x\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11671
			(*act.ilc_func)(self,
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11672
					@symbol(activate:view:),
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11673
					nil, &act,
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11674
					true, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11675
			break;
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11676
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11677
		    default:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11678
			break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11679
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11680
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11681
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11682
	    case WM_MOUSEACTIVATE:
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 11683
		if (__debug_WM_MOUSEACTIVATE__) {
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 11684
		    PRINTF((">>> WM_MOUSEACTIVATE h=%x -> focusInView:\n", ev->ev_hWnd));
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 11685
		}
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11686
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11687
		(*focIn.ilc_func)(self,
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11688
				  @symbol(focusInView:),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11689
				  nil, &focIn, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11690
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11691
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11692
	    case WM_SETFOCUS:
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11693
		DPRINTF((">>> WM_SETFOCUS h=%x -> focusInView:\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11694
		(*focIn.ilc_func)(self,
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11695
				  @symbol(focusInView:),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11696
				  nil, &focIn, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11697
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11698
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11699
	    case WM_KILLFOCUS:
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11700
		DPRINTF((">>> WM_KILLFOCUS h=%x -> focusOutOfView\n", ev->ev_hWnd));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11701
		(*focOut.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11702
				   @symbol(focusOutView:),
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11703
				   nil, &focOut, theView);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11704
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11705
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11706
	    case __WM_GEXPOSE:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11707
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11708
		y = ev->ev_y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11709
		w = ev->ev_w;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11710
		h = ev->ev_h;
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11711
		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
 11712
#if 0
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11713
		if (GetWindow_unmapping(hWnd)) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 11714
		    console_fprintf(stderr, "oops - __WM_GEXPOSE for unmapping\n");
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11715
		}
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 11716
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11717
		(*gexpS.ilc_func)(self,
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 11718
				  @symbol(graphicsExposeX:y:width:height:final:view:),
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11719
				  nil, &gexpS,
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11720
				  __MKSMALLINT(x),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11721
				  __MKSMALLINT(y),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11722
				  __MKSMALLINT(w),
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11723
				  __MKSMALLINT(h),
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 11724
				  ev->ev_wParam ? true : false,
2705
d16abb07c15b fixed graphicsExpose/noExpose handling (final-flag was wrong)
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
 11725
				  theView);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11726
		break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11727
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11728
	    case __WM_NOGEXPOSE:
4265
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
 11729
		DPRINTFIF(__debug_WM_EXPOSE__, (">>> __WM_NOGEXPOSE -> noExpose\n"));
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 11730
#if 0
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11731
		if (GetWindow_unmapping(hWnd)) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 11732
		    console_fprintf(stderr, "oops - __WM_NOGEXPOSE for unmapping\n");
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11733
		}
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 11734
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11735
		 (*nexpS.ilc_func)(self,
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11736
				   @symbol(noExposeView:), nil, &nexpS,
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11737
				   theView);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11738
		break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11739
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 11740
# ifdef LATE_GENERATE_EXPOSE
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 11741
	    case __WM_PAINT:
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 11742
		{
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 11743
		    PAINTSTRUCT ps;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 11744
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 11745
		    AQUIRE_DRAW_MUTEX
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 11746
		    __generateExposes(hWnd, NULL, WM_PAINT, 0);
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 11747
		    RELEASE_DRAW_MUTEX
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 11748
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 11749
# if 0
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 11750
		    BeginPaint(hWnd, &ps);
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 11751
		    EndPaint(hWnd, &ps);
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 11752
# endif
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 11753
		}
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 11754
		break;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 11755
# endif
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 11756
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11757
	    case WM_PAINT:
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
 11758
		x = ev->ev_x;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
 11759
		y = ev->ev_y;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
 11760
		w = ev->ev_w;
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
 11761
		h = ev->ev_h;
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11762
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 11763
#if 0
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11764
		if (GetWindow_unmapping(hWnd)) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 11765
		    console_fprintf(stderr, "oops - WM_PAINT for unmapping\n");
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11766
		}
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 11767
#endif
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 11768
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 11769
#ifndef PRE_21_NOV
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
 11770
		__clearWindow(hWnd, x, y, w, h);
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 11771
#else
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 11772
# if WM_PAINT_CLEAR_LATE
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 11773
		__clearWindow(hWnd, x, y, w, h);
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 11774
# endif
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 11775
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 11776
#endif
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 11777
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11778
#ifdef DEBUG_COLORIZE_WM_PAINT_RECTS2
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11779
		{
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11780
		    HDC hDC;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11781
		    HBRUSH hBrush;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11782
		    RECT rect;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11783
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11784
		    hBrush = CreateSolidBrush(BlackPixel);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11785
		    hDC = GetWindowDC(hWnd);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11786
		    SelectClipRgn(hDC, NULL);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11787
		    rect.left = x;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11788
		    rect.top = y;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11789
		    rect.right = x+w;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11790
		    rect.bottom = y+h;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11791
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11792
		    FillRect(hDC, &rect, hBrush);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11793
		    _DeleteBrush(hBrush, __LINE__);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11794
		    ReleaseDC(hWnd, hDC);
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11795
		}
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11796
#endif
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 11797
		if (__debug_WM_PAINT__) {
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 11798
		    PRINTF((">>> WM_PAINT -> expose %d/%d -> %d/%d\n", x, y, w, h));
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 11799
		}
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11800
		(*exp.ilc_func)(self,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11801
			 @symbol(exposeX:y:width:height:view:),
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11802
			 nil, &exp,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11803
			 __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11804
			 __MKSMALLINT(y),
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
 11805
			 __MKSMALLINT(w),
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
 11806
			 __MKSMALLINT(h),
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11807
			 theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11808
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11809
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11810
	    case WM_LBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11811
		isDoubleClick = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11812
		butt = __MKSMALLINT(Button1);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11813
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11814
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11815
	    case WM_LBUTTONUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11816
		isDown = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11817
		butt = __MKSMALLINT(Button1);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11818
		goto commonButtonDown;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11819
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11820
	    case WM_LBUTTONDOWN:
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11821
		butt = __MKSMALLINT(Button1);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11822
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11823
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11824
	    case WM_MBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11825
		isDoubleClick = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11826
		butt = __MKSMALLINT(Button2);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11827
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11828
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11829
	    case WM_MBUTTONUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11830
		isDown = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11831
		butt = __MKSMALLINT(Button2);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11832
		goto commonButtonDown;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11833
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11834
	    case WM_MBUTTONDOWN:
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11835
		butt = __MKSMALLINT(Button2);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11836
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11837
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11838
	    case WM_RBUTTONDBLCLK:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11839
		isDoubleClick = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11840
		butt = __MKSMALLINT(Button3);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11841
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11842
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11843
	    case WM_RBUTTONUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11844
		isDown = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11845
		butt = __MKSMALLINT(Button3);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11846
		goto commonButtonDown;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11847
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11848
	    case WM_RBUTTONDOWN:
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 11849
		butt = __MKSMALLINT(Button3);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11850
		goto commonButtonDown;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11851
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11852
	    commonButtonDown:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11853
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11854
		y = ev->ev_y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11855
		modifiers = ev->ev_modifiers;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11856
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11857
		if (__INST(buttonTranslation) != nil) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11858
		    butt = __AT_(__INST(buttonTranslation), butt);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11859
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11860
		arg = butt;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11861
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11862
		__INST(altDown) = (modifiers & AltMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11863
		__INST(metaDown) = (modifiers & MetaMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11864
		__INST(shiftDown) = (modifiers & ShiftMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11865
		__INST(ctrlDown) = (modifiers & ControlMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11866
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11867
		if (deltaDoubleClickX == -999) {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11868
		    deltaDoubleClickX = GetSystemMetrics(SM_CXDOUBLECLK);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11869
		    deltaDoubleClickY = GetSystemMetrics(SM_CYDOUBLECLK);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11870
		}
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11871
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 11872
		if (isDoubleClick) {
4476
4ba4a3ac09bc fix: double click in popup windows (affects ExtendedComboBox)
Claus Gittinger <cg@exept.de>
parents: 4462
diff changeset
 11873
		    multiClickCount = 2;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11874
		    ipS = &bmp;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11875
		    symS = @symbol(buttonMultiPress:x:y:view:);
4476
4ba4a3ac09bc fix: double click in popup windows (affects ExtendedComboBox)
Claus Gittinger <cg@exept.de>
parents: 4462
diff changeset
 11876
		    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
 11877
		} else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 11878
		    if (isDown) {
4476
4ba4a3ac09bc fix: double click in popup windows (affects ExtendedComboBox)
Claus Gittinger <cg@exept.de>
parents: 4462
diff changeset
 11879
			if (multiClickCount
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11880
			 && (ev->ev_time < nextMultiClickTime)
4610
4e7993041072 fix: do not treat two quick presses as double-click, if the button is different.
Claus Gittinger <cg@exept.de>
parents: 4578
diff changeset
 11881
			 && (butt == lastButton)
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11882
			 && (x >= (lastClickX - (deltaDoubleClickX / 2)))
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11883
			 && (x <= (lastClickX + (deltaDoubleClickX / 2)))
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11884
			 && (y >= (lastClickY - (deltaDoubleClickY / 2)))
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11885
			 && (y <= (lastClickY + (deltaDoubleClickY / 2)))
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11886
			) {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 11887
			    ipS = &bmp;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 11888
			    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
 11889
			} else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 11890
			    ipS = &bp;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 11891
			    symS = @symbol(buttonPress:x:y:view:);
4476
4ba4a3ac09bc fix: double click in popup windows (affects ExtendedComboBox)
Claus Gittinger <cg@exept.de>
parents: 4462
diff changeset
 11892
			    multiClickCount = 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11893
			}
4476
4ba4a3ac09bc fix: double click in popup windows (affects ExtendedComboBox)
Claus Gittinger <cg@exept.de>
parents: 4462
diff changeset
 11894
			multiClickCount = multiClickCount + 1;
4ba4a3ac09bc fix: double click in popup windows (affects ExtendedComboBox)
Claus Gittinger <cg@exept.de>
parents: 4462
diff changeset
 11895
			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
 11896
		    } else {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11897
			ipS = &br;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11898
			symS = @symbol(buttonRelease:x:y:view:);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11899
		    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11900
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11901
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11902
		if (isDown || isDoubleClick) {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11903
		    lastClickX = x;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11904
		    lastClickY = y;
4610
4e7993041072 fix: do not treat two quick presses as double-click, if the button is different.
Claus Gittinger <cg@exept.de>
parents: 4578
diff changeset
 11905
		    lastButton = butt;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11906
		}
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11907
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 11908
		if (__debug_WM_BUTTONUP__ | __debug_WM_BUTTONDOWN__) {
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 11909
		    if (__isSymbol(arg)) {
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 11910
			PRINTF(("buttonPress/buttonRelease: %s %d/%d\n",
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 11911
				    __stringVal(arg), x, y));
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 11912
		    } else {
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 11913
			PRINTF(("buttonPress/buttonRelease: %d %d/%d\n",
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 11914
				    __intVal(arg), x, y));
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 11915
		    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11916
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11917
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11918
		(*(*ipS).ilc_func)(self, symS, nil, ipS,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11919
				   arg,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11920
				   __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11921
				   __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11922
				   theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11923
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11924
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11925
	    case __WM_MOUSEENTER:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11926
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11927
		y = ev->ev_y;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11928
		state = ev->ev_modifiers;
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
 11929
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 11930
		if (__debug_WM_MOUSEENTER__) {
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 11931
		    PRINTF((">>> WM_MOUSEENTER: %x %d/%d state:%x\n", ev->ev_hWnd, x, y, state));
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 11932
		}
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 11933
#if 0
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11934
		if (GetWindow_unmapping(hWnd)) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 11935
		    console_fprintf(stderr, "oops - WM_MOUSEENTER for unmapping\n");
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11936
		}
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 11937
#endif
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11938
		(*pe.ilc_func)(self, @symbol(pointerEnter:x:y:view:),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11939
				    nil, &pe,
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11940
				    __MKSMALLINT(state),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11941
				    __MKSMALLINT(x),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11942
				    __MKSMALLINT(y),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11943
				    theView);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11944
		break;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11945
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11946
	    case __WM_MOUSELEAVE:
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11947
		state = ev->ev_modifiers;
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 11948
		if (__debug_WM_MOUSELEAVE__) {
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 11949
		    PRINTF((">>> WM_MOUSELEAVE: %x state:%x\n", ev->ev_hWnd, state));
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 11950
		}
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 11951
#if 0
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11952
		if (GetWindow_unmapping(hWnd)) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 11953
		    console_fprintf(stderr, "oops - WM_MOUSELEAVE for unmapping\n");
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 11954
		}
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 11955
#endif
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11956
		(*pl.ilc_func)(self, @symbol(pointerLeave:view:),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11957
				    nil, &pl,
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11958
				    __MKSMALLINT(state),
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11959
				    theView);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11960
		break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11961
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11962
	    case WM_MOUSEMOVE:
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11963
		x = ev->ev_x;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 11964
		y = ev->ev_y;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11965
		state = ev->ev_modifiers;
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 11966
		if (__debug_WM_MOUSEMOVE__) {
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 11967
		    PRINTF((">>> WM_MOUSEMOVE: %d/%d %x\n", x, y, state));
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 11968
		}
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11969
		(*mot.ilc_func)(self, @symbol(buttonMotion:x:y:view:),
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11970
				    nil, &mot,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11971
				    __MKSMALLINT(state),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11972
				    __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11973
				    __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11974
				    theView);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11975
		break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11976
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11977
#ifdef WM_MOUSEWHEEL
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11978
	    case WM_MOUSEWHEEL:
5231
7d35c3c15dfb x,y in mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 5230
diff changeset
 11979
		x = ev->ev_x;
7d35c3c15dfb x,y in mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 5230
diff changeset
 11980
		y = ev->ev_y;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11981
		state = ev->ev_modifiers;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11982
		dir = ev->ev_wParam;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11983
		DPRINTF((">>> WM_MOUSEWHEEL: %d %x\n", dir, state));
4455
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11984
		{
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11985
		    OBJ tim;
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11986
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11987
		    __PROTECT__(theView);
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11988
		    tim = __MKUINT(ev->ev_time);
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11989
		    __UNPROTECT__(theView);
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11990
		    (*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
 11991
				    nil, &mwh,
2733
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
 11992
				    __MKSMALLINT(state),
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
 11993
				    __MKSMALLINT(x),
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
 11994
				    __MKSMALLINT(y),
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11995
				    __MKSMALLINT(dir),
4455
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11996
				    tim,
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11997
				    theView);
4455
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11998
		}
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11999
		break;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 12000
#endif
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 12001
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12002
	    case WM_CHAR:
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 12003
		DPRINTFIF(__debug_WM_CHAR__  , ("WM_CHAR %x %d/%d\n", ev->ev_keyCode, ev->ev_x, ev->ev_y));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 12004
		DPRINTF((">>> WM_CHAR: %d/%d\n", x, y));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12005
		symS = @symbol(keyPress:x:y:view:);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 12006
		ipS = &skp;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12007
		upDown = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12008
		goto keyPressAndRelease;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12009
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12010
	    case WM_SYSKEYUP:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12011
	    case WM_KEYUP:
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 12012
		DPRINTFIF(__debug_WM_KEYUP__  , (">>> WM_KEYUP / SYSKEYUP: %x %d/%d\n", ev->ev_keyCode, ev->ev_x, ev->ev_y));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12013
		symS = @symbol(keyRelease:x:y:view:);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 12014
		ipS = &skr;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12015
		upDown = false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12016
		goto keyPressAndRelease;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12017
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12018
	    case WM_SYSKEYDOWN:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12019
	    case WM_KEYDOWN:
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 12020
		DPRINTFIF(__debug_WM_KEYUP__  , (">>> WM_KEYDOWN / SYSKEYDOWN: %x %d/%d\n", ev->ev_keyCode, ev->ev_x, ev->ev_y));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12021
		symS = @symbol(keyPress:x:y:view:);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 12022
		ipS = &skp;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12023
		upDown = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12024
		/* FALL INTO */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12025
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12026
	    keyPressAndRelease: ;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12027
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12028
		x = ev->ev_x;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12029
		y = ev->ev_y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12030
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12031
#ifdef NOTDEF
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12032
		{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12033
		    BYTE vKeyState[256];
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12034
		    char buff[5];
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12035
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 12036
		    GetKeyboardState(vKeyState);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12037
		    ToAscii(ev->ev_keyCode, ev->ev_scanCode, vKeyState, &buff; 0);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12038
		}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12039
#endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12040
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12041
		keyCode = ev->ev_keyCode;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12042
		modifiers = ev->ev_modifiers;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12043
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12044
		if (modifiers & TRANSLATED_KEY) {
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 12045
#if 1
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12046
		    if (modifiers & ControlMask) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12047
			if (keyCode < 0x20) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12048
			    keyCode = keyCode + 'a' - 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12049
			    if (modifiers & ShiftMask) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12050
				keyCode = keyCode - 'a' + 'A';
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12051
			    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12052
			}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12053
		    } else if (modifiers & (MetaMask | AltMask)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12054
			if (! (modifiers & ShiftMask)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12055
			    if ((keyCode >= 'A') && (keyCode <= 'Z')) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12056
				keyCode = keyCode - 'A' + 'a';
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12057
			    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12058
			}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12059
		    }
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 12060
#endif
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 12061
		    arg = __MKSMALLINT(keyCode & 0xFFFF);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12062
		} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12063
		    switch (keyCode) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12064
			case VK_F1:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12065
			    arg = @symbol(F1);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12066
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12067
			case VK_F2:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12068
			    arg = @symbol(F2);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12069
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12070
			case VK_F3:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12071
			    arg = @symbol(F3);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12072
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12073
			case VK_F4:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12074
			    arg = @symbol(F4);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12075
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12076
			case VK_F5:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12077
			    arg = @symbol(F5);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12078
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12079
			case VK_F6:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12080
			    arg = @symbol(F6);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12081
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12082
			case VK_F7:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12083
			    arg = @symbol(F7);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12084
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12085
			case VK_F8:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12086
			    arg = @symbol(F8);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12087
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12088
			case VK_F9:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12089
			    arg = @symbol(F9);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12090
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12091
			case VK_F10:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12092
			    arg = @symbol(F10);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12093
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12094
			case VK_F11:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12095
			    arg = @symbol(F11);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12096
			    break;
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12097
			case VK_F12:
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12098
			    arg = @symbol(F12);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12099
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12100
			case VK_PRIOR:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12101
			    arg = @symbol(Prior);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12102
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12103
			case VK_NEXT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12104
			    arg = @symbol(Next);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12105
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12106
			case VK_END:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12107
			    arg = @symbol(End);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12108
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12109
			case VK_HOME:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12110
			    arg = @symbol(Home);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12111
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12112
			case VK_LEFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12113
			    arg = @symbol(CursorLeft);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12114
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12115
			case VK_RIGHT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12116
			    arg = @symbol(CursorRight);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12117
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12118
			case VK_UP:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12119
			    arg = @symbol(CursorUp);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12120
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12121
			case VK_DOWN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12122
			    arg = @symbol(CursorDown);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12123
			    break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12124
			case VK_MENU:  /*alt key with w95 ???*/
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12125
			    arg = @symbol(Menu);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12126
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12127
			case VK_LMENU:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12128
			    arg = @symbol(Menu_L);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12129
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12130
			case VK_RMENU:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12131
			    arg = @symbol(Menu_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12132
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12133
			case VK_PAUSE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12134
			    arg = @symbol(Pause);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12135
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12136
			case VK_HELP:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12137
			    arg = @symbol(Help);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12138
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12139
			case VK_EXECUTE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12140
			    arg = @symbol(Execute);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12141
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12142
			case VK_CANCEL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12143
			    arg = @symbol(Cancel);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12144
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12145
			case VK_SELECT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12146
			    arg = @symbol(Select);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12147
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12148
			case VK_PRINT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12149
			    arg = @symbol(Print);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12150
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12151
			case VK_SNAPSHOT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12152
			    arg = @symbol(Snapshot);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12153
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12154
			case VK_INSERT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12155
			    arg = @symbol(Insert);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12156
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12157
			case VK_DELETE:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12158
			    arg = @symbol(Delete);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12159
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12160
			case VK_BACK:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12161
			    arg = @symbol(BackSpace);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12162
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12163
			case VK_LWIN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12164
			    arg = @symbol(Win_L);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12165
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12166
			case VK_RWIN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12167
			    arg = @symbol(Win_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12168
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12169
			case VK_APPS:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12170
			    arg = @symbol(Appl);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12171
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12172
			case VK_NUMPAD0:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12173
			    arg = @symbol(KeyPad0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12174
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12175
			case VK_NUMPAD1:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12176
			    arg = @symbol(KeyPad1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12177
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12178
			case VK_NUMPAD2:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12179
			    arg = @symbol(KeyPad2);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12180
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12181
			case VK_NUMPAD3:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12182
			    arg = @symbol(KeyPad3);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12183
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12184
			case VK_NUMPAD4:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12185
			    arg = @symbol(KeyPad4);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12186
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12187
			case VK_NUMPAD5:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12188
			    arg = @symbol(KeyPad5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12189
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12190
			case VK_NUMPAD6:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12191
			    arg = @symbol(KeyPad6);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12192
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12193
			case VK_NUMPAD7:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12194
			    arg = @symbol(KeyPad7);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12195
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12196
			case VK_NUMPAD8:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12197
			    arg = @symbol(KeyPad8);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12198
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12199
			case VK_NUMPAD9:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12200
			    arg = @symbol(KeyPad9);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12201
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12202
			case VK_LSHIFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12203
			    arg = @symbol(Shift_L);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12204
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12205
			case VK_RSHIFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12206
			    arg = @symbol(Shift_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12207
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12208
			case VK_LCONTROL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12209
			    arg = @symbol(Ctrl_L);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12210
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12211
			case VK_RCONTROL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12212
			    arg = @symbol(Ctrl_R);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12213
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12214
			case VK_CONTROL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12215
			    arg = @symbol(Ctrl);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12216
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12217
			case VK_SHIFT:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12218
			    arg = @symbol(Shift);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12219
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12220
			case VK_TAB:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12221
			    arg = @symbol(Tab);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12222
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12223
			case VK_ESCAPE:
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12224
			    arg = @symbol(Escape);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12225
			    break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12226
			case VK_NUMLOCK:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12227
			    arg = @symbol(NumLock);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12228
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12229
			case VK_SCROLL:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12230
			    arg = @symbol(ScrollLock);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12231
			    break;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12232
			case VK_RETURN:
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12233
			    arg = @symbol(Return);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12234
			    break;
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 12235
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12236
			default:
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 12237
#if 0
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12238
			    nameBuffer[0] = 0;
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 12239
			    GetKeyNameText(ev->ev_scanCode, nameBuffer, sizeof(nameBuffer));
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 12240
			    if (__debug_WM_KEYUP__ | __debug_WM_KEYDOWN__ | __debug_WM_CHAR__) {
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12241
				PRINTF(("char is <%d>\n", keyCode));
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12242
			    }
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 12243
#endif
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 12244
			    arg = __MKSMALLINT(keyCode & 0xFFFF);
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 12245
			    break;
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 12246
		    }
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12247
		}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12248
		__INST(altDown) = (modifiers & AltMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12249
		__INST(metaDown) = (modifiers & MetaMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12250
		__INST(shiftDown) = (modifiers & ShiftMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12251
		__INST(ctrlDown) = (modifiers & ControlMask) ? true : false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12252
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 12253
		if (__debug_WM_CHAR__ | __debug_WM_KEYUP__ | __debug_WM_KEYDOWN__) {
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 12254
		    PRINTF(("%s: code=%x mod=%x ", __stringVal(symS), keyCode, modifiers));
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 12255
		    PRINTF((" alt=%d meta=%d ", __INST(altDown) == true , __INST(metaDown) == true));
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 12256
		    PRINTF((" sh=%d ctrl=%d", __INST(shiftDown) == true , __INST(ctrlDown) == true));
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 12257
		    PRINTF((" arg=%x\n", arg));
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 12258
		}
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 12259
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12260
		(*(*ipS).ilc_func)(self, symS, nil, ipS,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12261
				   arg,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12262
				   __MKSMALLINT(x),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12263
				   __MKSMALLINT(y),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12264
				   theView);
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12265
		break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12266
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12267
	   case WM_SYSCOLORCHANGE:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12268
		DPRINTF((">>> WM_SYSCOLORCHANGE\n"));
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
 12269
		(*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
 12270
		break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12271
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12272
	   case WM_FONTCHANGE:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12273
		DPRINTF((">>> WM_FONTCHANGE\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12274
		(*fontChg.ilc_func)(self, @symbol(fontChange), nil, &fontChg);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12275
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12276
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 12277
	   case WM_WININICHANGE:
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 12278
		DPRINTF((">>> WM_WININICHANGE\n"));
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 12279
		(*settingChg.ilc_func)(self, @symbol(settingsChange), nil, &settingChg);
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 12280
		break;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 12281
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12282
	   case WM_DISPLAYCHANGE:
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12283
		DPRINTF((">>> WM_DISPLAYCHANGE\n"));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12284
		(*fontChg.ilc_func)(self, @symbol(displayChange), nil, &fontChg);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12285
		break;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 12286
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12287
	   case WM_QUERYENDSESSION:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12288
		DPRINTF((">>> WM_QUERYENDSESSION\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12289
		(*qEndSess.ilc_func)(self, @symbol(queryEndSession), nil, &qEndSess);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12290
		break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12291
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12292
#ifdef LATER
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12293
	   case WM_POWER:
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12294
		DPRINTF((">>> WM_POWER\n"));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12295
		(*power.ilc_func)(self, @symbol(powerDown), nil, &power);
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12296
	       break;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12297
#endif
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12298
	    /* native widget actions */
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
 12299
	    case WM_COMMAND:
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
 12300
		DPRINTF((">>> WM_COMMAND\n"));
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
 12301
		(*command.ilc_func)(self, @symbol(nativeWidgetCommand:view:), nil, &command,
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
 12302
				__MKSMALLINT(ev->ev_wParam), theView);
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
 12303
	       break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12304
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 12305
	    /* tray action */
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 12306
	    case WM_TRAY_MESSAGE:
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 12307
		DPRINTF((">>> WM_TRAY_MESSAGE\n"));
4832
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 12308
		(*trayMessage.ilc_func)(self, @symbol(trayAction:view:), nil, &trayMessage,
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 12309
				__MKSMALLINT(ev->ev_arg1), theView);
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 12310
		break;
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 12311
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 12312
	    /* message from another process */
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 12313
	    case WM_COPYDATA:
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 12314
		DPRINTF((">>> WM_COPYDATA\n"));
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 12315
		{
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 12316
		    OBJ eventData;
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 12317
		    void *data = (void *)(ev->ev_arg1);
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 12318
		    int nBytes = ev->ev_arg2;
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 12319
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 12320
		    if (ev->ev_arg1) {
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 12321
			__PROTECT__(theView);
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 12322
			eventData = __MKBYTEARRAY(data, nBytes);
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 12323
			__UNPROTECT__(theView);
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 12324
		    } else {
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 12325
			eventData = nil;
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 12326
		    }
5023
d4ce50f55568 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5018
diff changeset
 12327
		    (*copyData.ilc_func)(self, @symbol(copyDataEvent:eventData:view:), nil, &copyData,
d4ce50f55568 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5018
diff changeset
 12328
				__MKSMALLINT(ev->ev_wParam), eventData, theView);
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 12329
		}
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 12330
		break;
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 12331
4832
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 12332
#ifdef LATER
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 12333
	    case WM_QUIT:
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 12334
		DPRINTF((">>> WM_QUIT_MESSAGE\n"));
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 12335
		(*quit.ilc_func)(self, @symbol(quitCommand:), nil, &quit);
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 12336
		break;
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 12337
#endif
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12338
	    case WM_HSCROLL:
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12339
	    case WM_VSCROLL:
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12340
		{
4237
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 12341
		    int scrollCode = 0;
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 12342
		    OBJ scrollCodeOrScrollCodeSymbol = nil, positionOrNil = nil;
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 12343
		    int pos = 0;
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12344
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12345
		    scrollCode = LOWORD(ev->ev_wParam);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12346
		    scrollCodeOrScrollCodeSymbol = __MKSMALLINT(scrollCode);
4237
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 12347
		    positionOrNil = nil;
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12348
		    switch (scrollCode) {
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12349
			case SB_BOTTOM:
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12350
			    scrollCodeOrScrollCodeSymbol = @symbol(SB_BOTTOM);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12351
			    break;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12352
			case SB_TOP:
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12353
			    scrollCodeOrScrollCodeSymbol = @symbol(SB_TOP);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12354
			    break;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12355
			case SB_ENDSCROLL:
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12356
			    scrollCodeOrScrollCodeSymbol = @symbol(SB_ENDSCROLL);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12357
			    break;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12358
			case SB_LINEDOWN:
4239
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 12359
			    if (ev->ev_message == WM_HSCROLL) {
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 12360
				scrollCodeOrScrollCodeSymbol = @symbol(SB_LINERIGHT);
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 12361
			    } else {
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 12362
				scrollCodeOrScrollCodeSymbol = @symbol(SB_LINEDOWN);
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 12363
			    }
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12364
			    break;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12365
			case SB_LINEUP:
4239
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 12366
			    if (ev->ev_message == WM_HSCROLL) {
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 12367
				scrollCodeOrScrollCodeSymbol = @symbol(SB_LINELEFT);
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 12368
			    } else {
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 12369
				scrollCodeOrScrollCodeSymbol = @symbol(SB_LINEUP);
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 12370
			    }
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12371
			    break;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12372
			case SB_PAGEDOWN:
4239
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 12373
			    if (ev->ev_message == WM_HSCROLL) {
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
 12374
				scrollCodeOrScrollCodeSymbol = @symbol(SB_PAGERIGHT);
4239
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 12375
			    } else {
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 12376
				scrollCodeOrScrollCodeSymbol = @symbol(SB_PAGEDOWN);
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 12377
			    }
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12378
			    break;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12379
			case SB_PAGEUP:
4239
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 12380
			    if (ev->ev_message == WM_HSCROLL) {
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 12381
				scrollCodeOrScrollCodeSymbol = @symbol(SB_PAGELEFT);
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 12382
			    } else {
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 12383
				scrollCodeOrScrollCodeSymbol = @symbol(SB_PAGEUP);
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 12384
			    }
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12385
			    break;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12386
			case SB_THUMBPOSITION:
4240
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 12387
			    if (ev->ev_message == WM_HSCROLL) {
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 12388
				scrollCodeOrScrollCodeSymbol = @symbol(SB_THUMBPOSITIONHORIZONTAL);
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 12389
			    } else {
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 12390
				scrollCodeOrScrollCodeSymbol = @symbol(SB_THUMBPOSITIONVERTICAL);
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 12391
			    }
4237
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 12392
			    pos = HIWORD(ev->ev_wParam);
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 12393
			    positionOrNil = __MKSMALLINT(pos);
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 12394
			    break;
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 12395
			case SB_THUMBTRACK:
4241
fdcafa929dd9 *** empty log message ***
ca
parents: 4240
diff changeset
 12396
			    if (ev->ev_message == WM_HSCROLL) {
fdcafa929dd9 *** empty log message ***
ca
parents: 4240
diff changeset
 12397
				scrollCodeOrScrollCodeSymbol = @symbol(SB_THUMBTRACKHORIZONTAL);
fdcafa929dd9 *** empty log message ***
ca
parents: 4240
diff changeset
 12398
			    } else {
fdcafa929dd9 *** empty log message ***
ca
parents: 4240
diff changeset
 12399
				scrollCodeOrScrollCodeSymbol = @symbol(SB_THUMBTRACKVERTICAL);
fdcafa929dd9 *** empty log message ***
ca
parents: 4240
diff changeset
 12400
			    }
4237
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 12401
			    pos = HIWORD(ev->ev_wParam);
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 12402
			    positionOrNil = __MKSMALLINT(pos);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12403
			    break;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12404
			default:
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12405
			    DPRINTF((">>> WM_SCROLL: unhandled scrollCode:%d %d\n", scrollCode));
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12406
			    break;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12407
		    }
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12408
		    NDPRINTF((">>> WM_SCROLL: %d %d\n", scrollCode, pos));
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12409
4239
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 12410
		    (*win32NativeScroll.ilc_func)(self, @symbol(win32NativeScroll:position:view:),
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 12411
					nil, &win32NativeScroll,
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12412
					scrollCodeOrScrollCodeSymbol,
4237
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 12413
					positionOrNil,
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12414
					theView);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12415
		}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12416
		break;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 12417
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
 12418
	    case WM_DRAWITEM:
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
 12419
		{
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
 12420
		    NDPRINTF((">>> WM_DRAWITEM: wParam: %x\n", ev->ev_wParam));
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
 12421
		    (*win32DrawItem.ilc_func)(self, @symbol(win32DrawItem:view:),
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
 12422
					nil, &win32DrawItem,
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
 12423
					__MKSMALLINT(ev->ev_wParam),
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
 12424
					theView);
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
 12425
		}
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
 12426
		break;
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
 12427
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12428
	    default:
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12429
		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
 12430
		break;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12431
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12432
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12433
    ^ true
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12434
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12435
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12436
dispatchPendingEvents
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12437
    "central event handling method for modal operation.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12438
     (i.e. this is now only used in the modal debugger)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12439
     Dispatch any pending events; return when no more are pending.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12440
     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
 12441
     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
 12442
     we only handle exposes until the graphicsExpose arrives.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12443
     Other systems may not need such a kludge"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12444
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12445
    [self eventPendingWithSync:false] whileTrue:[
4440
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12446
	(self getEventFor:nil withMask:nil) ifTrue:[
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 12447
	    AbortOperationRequest handle:[:ex |
4440
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12448
		ex return
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12449
	    ] do:[
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12450
		self dispatchLastEvent.
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12451
		"/ multi-screen config: give others a chance
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12452
		"/ (needed because we run at high (non-timesliced) prio)
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12453
		Processor yield.
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12454
	    ]
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12455
	].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12456
    ]
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12457
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12458
    "Modified: 19.8.1997 / 17:11:18 / cg"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12459
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12460
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12461
disposeEventsWithMask:aMask for:aWindowIdOrNil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12462
    "dispose (throw away) specific events. If aWindowId is nil,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12463
     events matching the mask are thrown away regardless of which
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12464
     view they are for. Otherwise, only matching events for that
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12465
     view are flushed."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12466
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12467
%{  /* NOCONTEXT */
2733
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
 12468
   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
 12469
   RETURN ( self );
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12470
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12471
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12472
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12473
eventMaskFor:anEventSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12474
    "return the eventMask bit-constant corresponding to an event symbol"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12475
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12476
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12477
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12478
    int m = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12479
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12480
    if (anEventSymbol == @symbol(keyPress)) m = KeyPressMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12481
    else if (anEventSymbol == @symbol(keyRelease)) m = KeyReleaseMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12482
    else if (anEventSymbol == @symbol(buttonPress)) m = ButtonPressMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12483
    else if (anEventSymbol == @symbol(buttonRelease)) m = ButtonReleaseMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12484
    else if (anEventSymbol == @symbol(buttonMotion)) m = ButtonMotionMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12485
    else if (anEventSymbol == @symbol(pointerMotion)) m = PointerMotionMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12486
    else if (anEventSymbol == @symbol(expose)) m = ExposureMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12487
    else if (anEventSymbol == @symbol(focusChange)) m = FocusChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12488
    else if (anEventSymbol == @symbol(enter)) m = EnterWindowMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12489
    else if (anEventSymbol == @symbol(leave)) m = LeaveWindowMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12490
    else if (anEventSymbol == @symbol(keymapState)) m = KeymapStateMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12491
    else if (anEventSymbol == @symbol(visibilityChange)) m = VisibilityChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12492
    else if (anEventSymbol == @symbol(structureNotify)) m = StructureNotifyMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12493
    else if (anEventSymbol == @symbol(resizeRedirect)) m = ResizeRedirectMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12494
    else if (anEventSymbol == @symbol(propertyChange)) m = PropertyChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12495
    else if (anEventSymbol == @symbol(colormapChange)) m = ColormapChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12496
    RETURN (__MKSMALLINT(m));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12497
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12498
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12499
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12500
eventPending
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12501
    "return true, if any event is pending.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12502
     This looks for both the internal queue and the display connection."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12503
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12504
    ^ self eventPendingWithSync:false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12505
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12506
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12507
eventPending:anEventSymbol for:aWindowIdOrNil
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12508
    "return true, if a specific event is pending"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12509
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12510
    ^ self eventsPending:(self eventMaskFor:anEventSymbol) for:aWindowIdOrNil withSync:false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12511
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12512
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12513
eventPendingWithSync:doSync
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12514
    "return true, if any event is pending.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12515
     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
 12516
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12517
    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
 12518
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 12519
%{
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12520
    if (hasEventQueued()) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12521
	RETURN (true);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 12522
    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 12523
%}.
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12524
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12525
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12526
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12527
eventQueued
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12528
    "return true, if any event is queued"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12529
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12530
    ^ self eventQueuedAlready
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12531
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12532
    "Created: 12.12.1995 / 21:43:00 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12533
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12534
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12535
eventQueuedAlready
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12536
    "return true, if any event is queued internally.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12537
     (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
 12538
      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
 12539
      the display connection)."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12540
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 12541
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12542
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12543
    DDPRINTF(("peek q - "));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12544
    if (hasEventQueued()) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12545
	DDPRINTF(("true\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12546
	RETURN (true);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12547
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12548
    DDPRINTF(("false\n"));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12549
%}.
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12550
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12551
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12552
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12553
eventsPending:anEventMask for:aWindowIdOrNil withSync:doSync
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
 12554
    "return true, if any of the masked events is pending.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
 12555
     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
 12556
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12557
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12558
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 12559
    DDPRINTF(("eventsPending mask %x - not implemented\n", __intVal(anEventMask)));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12560
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12561
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12562
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12563
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12564
exposeEventPendingFor:aWindowIdOrNil withSync:doSync
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12565
    "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
 12566
     or any view (if the arg is nil).
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
 12567
     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
 12568
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12569
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12570
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12571
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12572
getEventFor:aViewIdOrNil withMask:eventMask
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12573
    "read next event - put into local eventBuffer.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12574
     If aViewIdOrNil is nil, events for any view are fetched;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12575
     otherwise only events for that specific view will be fetched.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12576
     Returns true, if there was an event, false otherwise."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12577
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 12578
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12579
    HWND win, wWanted;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12580
    int evMask;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12581
    OBJ eB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12582
    struct queuedEvent *ev;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12583
    struct queuedEvent *qev;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12584
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12585
    eB = __INST(eventBuffer);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12586
    if (! __isByteArray(eB)) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 12587
	console_fprintf(stderr, "WinWorkstation [error]: no eventBuffer\n");
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12588
	/* RETURN (false); */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12589
    } else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12590
	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
 12591
	ev->ev_message = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12592
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12593
	if (__isSmallInteger(eventMask)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12594
	    evMask = __intVal(eventMask);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12595
	} else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12596
	    evMask = ~0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12597
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12598
	if (__isExternalAddress(aViewIdOrNil)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12599
	    wWanted = _HWNDVal(aViewIdOrNil);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12600
	} else{
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12601
	    wWanted = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12602
	}
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
 12603
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12604
	do { /* only to allow continue */
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12605
	    if (deqEvent(ev, wWanted, evMask)) {
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 12606
#ifdef COMPRESS_WINDOWPOSCHANGED
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12607
		if ((ev->ev_hWnd == lastPos_win)
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12608
		 && (ev->ev_message == WM_WINDOWPOSCHANGED)
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12609
		 && ((ev->ev_x != lastPos_x)
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12610
		     || (ev->ev_y != lastPos_y)
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12611
		     || (ev->ev_w != lastPos_w)
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12612
		     || (ev->ev_h != lastPos_h))) {
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12613
		    /*
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 12614
		     * ignore intermediate resize events
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 12615
		     * (that event is an intermediate one, because the peek-values
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 12616
		     *  have already been updated for another event)
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12617
		     */
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12618
		    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
 12619
				  ev->ev_x, lastPos_x,
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12620
				  ev->ev_y, lastPos_y,
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12621
				  ev->ev_w, lastPos_w,
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12622
				  ev->ev_h, lastPos_h ));
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12623
		    continue;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12624
		}
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 12625
#endif
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12626
		RETURN ( true );
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12627
	    }
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12628
	} while (0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12629
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12630
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12631
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12632
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12633
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12634
handleAllEvents
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12635
    "from now on, handle any kind of event.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12636
     Always with win32."
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12637
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12638
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12639
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12640
handleExposeOnlyFor:aView
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12641
    "from now on, handle expose events only.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12642
     Never with win32."
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12643
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12644
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12645
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12646
setEventMask:aMask in:aWindowId
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 12647
    "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
 12648
     is the bitwise-or of the eventMask bits (see 'eventMaskFor:')"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12649
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12650
%{  /* NOCONTEXT */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12651
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12652
    if (__isExternalAddress(aWindowId)
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12653
     && __isSmallInteger(aMask)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12654
	HWND hWnd = _HWNDVal(aWindowId);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12655
	int mask = __intVal(aMask);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12656
	localWindowInfo *lI;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12657
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 12658
	lI = GETLOCALWINDOWINFOPTR(hWnd);
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 12659
	if (lI) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12660
#ifdef DEBUGMASK
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12661
	    PRINTF(("new eventMask %x\n",mask));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12662
	    printMask(mask);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12663
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12664
	    lI->eventMask = mask;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12665
	    RETURN ( self );
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12666
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12667
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12668
%}.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12669
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12670
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12671
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12672
!WinWorkstation methodsFor:'event sending'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12673
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12674
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
 12675
    "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
 12676
     TypeSymbol must be one of: #keyPress, #keyRelease, #buttonPress , #buttonRelease.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12677
     For buttonEvents, the keySymCodeOrButtonNr must be the buttons number (1, 2 ...);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12678
     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
 12679
     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
 12680
     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
 12681
     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
 12682
     (not very user friendly)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12683
2672
81c4e65507df *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2670
diff changeset
 12684
    'WinWorkstation [warning]: sendKeyOrButtonEvent unimplemented' infoPrintCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12685
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12686
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12687
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12688
!WinWorkstation methodsFor:'font stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12689
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12690
createFontFor:aFontName
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12691
    "a basic method for font allocation; this method allows
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12692
     any font to be aquired (even those not conforming to
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12693
     standard naming conventions, such as cursor, fixed or k14)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12694
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 12695
%{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12696
    HGDIOBJ hFont;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12697
    char *fn;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12698
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 12699
    if (__isStringLike(aFontName)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12700
	fn = __stringVal(aFontName);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12701
	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
 12702
	    hFont = GetStockObject(ANSI_FIXED_FONT);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12703
	} 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
 12704
	    hFont = GetStockObject(ANSI_VAR_FONT);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12705
	} else if ((strcmp(fn, "system") == 0) || (strcmp(fn, "SYSTEM_FONT") == 0)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12706
	    hFont = GetStockObject(SYSTEM_FONT);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12707
	} 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
 12708
	    hFont = GetStockObject(SYSTEM_FIXED_FONT);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12709
	} 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
 12710
	    hFont = GetStockObject(DEVICE_DEFAULT_FONT);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12711
	} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12712
	    hFont = GetStockObject(ANSI_FIXED_FONT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12713
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12714
	if (hFont) {
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 12715
	    DPRINTF(("createFontFor:%s -> %x\n", fn, hFont));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12716
	    RETURN ( __MKOBJ(hFont) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12717
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12718
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12719
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12720
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12721
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12722
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 12723
fontDescriptionFromLogicalFontInfoArray:anInfoArray
3972
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 12724
    |fntDescr family face style logicalSize pointSize encoding|
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 12725
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 12726
    family := anInfoArray at:16.
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 12727
    face   := anInfoArray at:6.
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 12728
    style  := anInfoArray at:15.
3972
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 12729
    logicalSize   := anInfoArray at:1.
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 12730
    encoding := anInfoArray at:17.
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 12731
3972
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 12732
    logicalSize := logicalSize abs.
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 12733
    "/ convert from device to point size
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 12734
    pointSize := (logicalSize / self getLogicalPixelSizeY * 72.0).
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 12735
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 12736
    fntDescr := FontDescription
5230
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
 12737
		    family:family
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
 12738
		    face:face
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
 12739
		    style:style
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
 12740
		    size:pointSize
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
 12741
		    sizeUnit:#pt
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
 12742
		    encoding:encoding.
5198
a95b6a853a3b changed #pixelSize
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
 12743
    fntDescr setPixelSize:logicalSize.
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 12744
    ^ fntDescr.
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 12745
!
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 12746
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 12747
fontMetricsOf:fontId
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 12748
    "return a fonts metrics info object"
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 12749
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 12750
    |rawData info|
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12751
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 12752
    rawData := Array new:15.
3481
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 12753
    (self primFontMetricsOf:fontId intoArray:rawData) isNil ifTrue:[
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12754
	self primitiveFailed.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12755
	^ self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12756
    ].
3481
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 12757
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 12758
    info := DeviceWorkstation::DeviceFontMetrics new.
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 12759
    info
3481
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 12760
      ascent:(rawData at:1)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 12761
      descent:(rawData at:2)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 12762
      maxAscent:(rawData at:3)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 12763
      maxDescent:(rawData at:4)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 12764
      minWidth:(rawData at:5)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 12765
      maxWidth:(rawData at:6)
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 12766
      avgWidth:(rawData at:7)
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 12767
      minCode:(rawData at:8)
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 12768
      maxCode:16rFFFF "(rawData at:9)"
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 12769
      direction:nil
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 12770
      encoding:(rawData at:11).
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 12771
    ^ info
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12772
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12773
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12774
fontsInFamily:aFamilyName face:aFaceName filtering:filter
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12775
    "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
 12776
     On WinWorkStations there is curently Face
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12777
     But only thise matching filter (if nonNil)."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12778
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12779
    |allFonts fonts|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12780
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12781
    allFonts := self listOfAvailableFonts.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12782
    allFonts isNil ifTrue:[^ nil].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12783
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12784
    fonts := Set new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12785
    allFonts do:[:fntDescr |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12786
	(aFamilyName sameAs:(fntDescr family)) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12787
	    (filter isNil or:[filter value:fntDescr]) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12788
		fonts add:fntDescr
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12789
	    ]
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12790
	]
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12791
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12792
    ^ fonts
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12793
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12794
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12795
getAvailableFontsMatching:pattern
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12796
    "return an Array filled with font names matching aPattern"
4523
df48174867cc Do not collapse a maximized window on #activate:
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
 12797
    self shouldImplement.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12798
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12799
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12800
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12801
getDefaultFont
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12802
    "return a default font id - used when class Font cannot
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12803
     find anything usable"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12804
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12805
     ^ self createFontFor:'fixed'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12806
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12807
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12808
getFontWithFamily:familyString face:faceString
5190
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 12809
	    style:styleArgString size:sizeArg sizeUnit:sizeUnitArg
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 12810
	    encoding:encodingSym
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12811
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12812
    "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
 12813
     font."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12814
5190
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 12815
    |styleString theName theId xlatedStyle id spacing pxSize ptSize|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12816
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12817
    styleString := styleArgString.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12818
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12819
    "special: if face is nil, allow access to X-fonts"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12820
    faceString isNil ifTrue:[
5190
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 12821
	sizeArg notNil ifTrue:[
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 12822
	    theName := familyString , '-' , sizeArg printString
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12823
	] ifFalse:[
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12824
	    theName := familyString
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12825
	].
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12826
	theName isNil ifTrue:[
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12827
	    "
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12828
	     mhmh - fall back to the default font
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12829
	    "
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12830
	    theName := 'fixed'
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12831
	].
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12832
	theId := self createFontFor:theName.
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12833
	theId isNil ifTrue:[
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12834
	    theId := self getDefaultFont
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12835
	].
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12836
	^ theId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12837
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12838
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12839
    "/ spacing other than 'normal' is contained as last component
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12840
    "/ in style
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 12841
    styleString notNil ifTrue:[
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12842
	((styleString endsWith:'-narrow')
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12843
	 or:[styleString endsWith:'-semicondensed']) ifTrue:[
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12844
	    |i|
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12845
	    i := styleString lastIndexOf:$-.
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12846
	    spacing := styleString copyFrom:(i+1).
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12847
	    styleString := styleString copyTo:(i-1).
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12848
	] ifFalse:[
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12849
	    spacing := 'normal'.
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12850
	].
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12851
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12852
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12853
    xlatedStyle := styleString.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12854
    xlatedStyle notNil ifTrue:[
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12855
	xlatedStyle := xlatedStyle first asString
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12856
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12857
5190
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 12858
    pxSize := sizeUnitArg == #px ifTrue:[sizeArg] ifFalse:[nil].
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 12859
    ptSize := sizeUnitArg == #pt ifTrue:[sizeArg] ifFalse:[nil].
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 12860
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12861
    id := self
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12862
	    getFontWithFoundry:'*'
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12863
	    family:familyString asLowercase
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12864
	    weight:faceString
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12865
	    slant:styleString "/ xlatedStyle
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12866
	    spacing:spacing
5190
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 12867
	    pixelSize:pxSize
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 12868
	    size:ptSize
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12869
	    registry:'*'
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12870
	    encoding:encodingSym.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12871
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12872
    id isNil ifTrue:[
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12873
	(encodingSym notNil and:[encodingSym ~= '*']) ifTrue:[
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12874
	    "/ too stupid: encodings come in both cases
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12875
	    id := self
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12876
		    getFontWithFoundry:'*'
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12877
		    family:familyString asLowercase
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12878
		    weight:faceString
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12879
		    slant:styleString
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12880
		    spacing:spacing
5190
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 12881
		    pixelSize:pxSize
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 12882
		    size:ptSize
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12883
		    registry:'*'
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12884
		    encoding:encodingSym asUppercase.
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12885
	    id isNil ifTrue:[
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12886
		id := self
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12887
			getFontWithFoundry:'*'
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12888
			family:familyString asLowercase
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12889
			weight:faceString
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12890
			slant:styleString
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12891
			spacing:spacing
5190
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 12892
			pixelSize:pxSize
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 12893
			size:ptSize
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12894
			registry:'*'
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12895
			encoding:encodingSym asLowercase.
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12896
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12897
		id isNil ifTrue:[
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12898
		    id := self
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12899
			    getFontWithFoundry:'*'
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12900
			    family:familyString asLowercase
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12901
			    weight:faceString asLowercase
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12902
			    slant:styleString asLowercase
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12903
			    spacing:spacing
5190
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 12904
			    pixelSize:pxSize
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 12905
			    size:ptSize
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12906
			    registry:'*'
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12907
			    encoding:encodingSym asLowercase.
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12908
		]
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12909
	    ]
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12910
	]
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12911
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12912
    ^ id
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12913
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12914
    "Modified: 24.2.1996 / 22:37:24 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12915
    "Modified: 4.7.1996 / 11:38:47 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12916
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12917
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12918
getFontWithFoundry:foundry family:family weight:weight
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12919
	      slant:slant spacing:spc pixelSize:pixelSizeOrNil size:pointSize
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12920
	      registry:registry encoding:encoding
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12921
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12922
    "get the specified font, if not available, return nil.
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12923
     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
 12924
     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
 12925
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12926
     foundry:   'adobe', 'misc', 'dec', 'schumacher' ... usually '*'
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12927
     family:    'helvetica' 'courier' 'times' ...
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12928
     weight:    'bold' 'medium' 'demi' ...
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12929
     slant:     'r(oman)' 'i(talic)' 'o(blique)'
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12930
     spacing:   'narrow' 'normal' semicondensed' ... usually '*'
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12931
     pixelSize: 16,18 ... size in pixels; usually left nil
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12932
     size:      size in point (1/72th of an inch). Overwritten by pixelSize if that is not nil
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12933
     registry:  iso8859, sgi ... '*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12934
     encoding:  vendor specific encoding (usually '*')
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12935
    "
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12936
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12937
    "
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12938
     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
 12939
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12940
	nHeight
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12941
	nWidth
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12942
	nEscapement
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12943
	nOrientation
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12944
	fnWeight        FW_DONTCARE, FW_NORMAL, FW_MEDIUM, FW_BOLD, ...
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12945
	fdwItalic       TRUE or FALSE
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12946
	fdwUnderline    TRUE or FALSE
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12947
	fdwStrikeOut    TRUE or FALSE
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12948
	fdwCharSet      ANSI_CHARSET, UNICODE_, SYMBOL_, SHIFTJIS_,...
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12949
	fdwOutputPrecision      DEFAULT, STRING, CHAR, ...
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12950
	fdwClipPrecision        DEFAULT, CHAR, STROKE, MASK, ...
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12951
	fdwQuality      DEFAULT, DRAFT, or PROOF.
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12952
	fdwPitchAndFamily
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12953
		DEFAULT, FIXED or VARIABLE pitch
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12954
		DECORATIVE, DONTCASE, MODERN, ROMAN, SCRIPT, or SWISS.
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12955
	lpszFace
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12956
		Typeface Name
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12957
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12958
      These two above descriptions will be matched as follows:
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12959
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12960
	foundry   - ignored
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12961
	family    - mapped to type face name.
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12962
	weight    - mapped to fnWeight
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12963
	slant     - used for style
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12964
	spacing   - NOT USED INITIALLY
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12965
	pixelSize - NOT USED INITIALLY
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12966
	size      - mapped to nHeight
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12967
	registry  - NOT USED INITIALLY
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12968
	encoding  - mapped to fdwCharSet
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12969
     "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12970
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 12971
    |logSize heightIsCellHeight|
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 12972
5171
333471dbc830 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5163
diff changeset
 12973
    pixelSizeOrNil notNil ifTrue:[
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12974
	logSize := pixelSizeOrNil.
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12975
	heightIsCellHeight := false.
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 12976
    ] ifFalse:[
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12977
	logSize := (pointSize * (self getLogicalPixelSizeY) / 72.0) rounded.
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 12978
	heightIsCellHeight := false.
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 12979
    ].
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 12980
%{
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 12981
    HGDIOBJ hFont;
5188
8946ef7cf787 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5184
diff changeset
 12982
    int nHeight, nWidth, nEscapement, nOrientation;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 12983
    char* work;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 12984
    char* work2;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 12985
    DWORD fnWeight;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 12986
    DWORD fdwItalic;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 12987
    DWORD fdwUnderline;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 12988
    DWORD fdwStrikeOut;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 12989
    DWORD fdwCharSet;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 12990
    DWORD fdwOutputPrecision;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 12991
    DWORD fdwClipPrecision;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 12992
    DWORD fdwQuality;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 12993
    DWORD fdwPitchAndFamily;
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 12994
    static char faceName[256];
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 12995
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 12996
/* INITIALIZE */
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 12997
    strcpy( faceName, "NULL" );
3972
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 12998
    nHeight   = 0;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 12999
    nWidth   = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13000
    nEscapement = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13001
    nOrientation = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13002
    fnWeight = FW_NORMAL;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13003
    fdwItalic = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13004
    fdwUnderline = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13005
    fdwStrikeOut = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13006
    fdwOutputPrecision = OUT_DEFAULT_PRECIS;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13007
    fdwClipPrecision   = CLIP_DEFAULT_PRECIS;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13008
    fdwQuality         = DEFAULT_QUALITY;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13009
    fdwPitchAndFamily  = FF_DONTCARE;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13010
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13011
    fdwCharSet   = ANSI_CHARSET;
4013
cd666b168135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4009
diff changeset
 13012
    if ((encoding == @symbol('ms-ansi'))) {
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13013
	fdwCharSet   = ANSI_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13014
    } else if (encoding == @symbol('ms-default')) {
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13015
	fdwCharSet   = DEFAULT_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13016
    } else if ((encoding == @symbol('ms-symbol'))
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13017
	    || (encoding == @symbol('misc-fontspecific'))) {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13018
	fdwCharSet   = SYMBOL_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13019
    } else if ((encoding == @symbol('ms-shiftjis'))
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13020
	    || (encoding == @symbol('jisx0208.1983-0'))){
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13021
	fdwCharSet   = SHIFTJIS_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13022
    } else if ((encoding == @symbol('ms-gb2312'))
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13023
	    || (encoding == @symbol('gb2312.1980-0'))) {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13024
	fdwCharSet   = GB2312_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13025
    } else if ((encoding == @symbol('ms-hangeul'))
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13026
	    || (encoding == @symbol('ksc5601.1987-0'))) {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13027
	fdwCharSet   = HANGEUL_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13028
    } else if ((encoding == @symbol('ms-chinesebig5'))
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13029
	    || (encoding == @symbol('big5'))) {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13030
	fdwCharSet   = CHINESEBIG5_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13031
    } else if (encoding == @symbol('ms-oem')) {
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13032
	fdwCharSet   = OEM_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13033
    } else if (encoding == @symbol('ms-johab')) {
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13034
	fdwCharSet   = JOHAB_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13035
    } else if ((encoding == @symbol('ms-hebrew'))
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13036
	    || (encoding == @symbol('ms-cp1255'))) {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13037
	fdwCharSet   = HEBREW_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13038
    } else if ((encoding == @symbol('ms-arabic'))
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13039
	    || (encoding == @symbol('ms-cp1256'))) {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13040
	fdwCharSet   = ARABIC_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13041
    } else if ((encoding == @symbol('ms-greek'))
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13042
	    || (encoding == @symbol('ms-cp1253'))) {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13043
	fdwCharSet   = GREEK_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13044
    } else if ((encoding == @symbol('ms-turkish'))
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13045
	    || (encoding == @symbol('ms-cp1254'))) {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13046
	fdwCharSet   = TURKISH_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13047
    } else if ((encoding == @symbol('ms-russian'))
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13048
	    || (encoding == @symbol('ms-cp1251'))) {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13049
	fdwCharSet   = RUSSIAN_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13050
    } else if ((encoding == @symbol('ms-easteurope'))
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13051
	    || (encoding == @symbol('ms-cp1250'))) {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13052
	fdwCharSet   = EASTEUROPE_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13053
    } else if ((encoding == @symbol('ms-baltic'))
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13054
	    || (encoding == @symbol('ms-cp1257'))) {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13055
	fdwCharSet   = BALTIC_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13056
    } else if ((encoding == @symbol('ms-vietnamese'))) {
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13057
	fdwCharSet   = VIETNAMESE_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13058
    } else if ((encoding == @symbol('ms-thai'))) {
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13059
	fdwCharSet   = THAI_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13060
    } else if ((encoding == @symbol('ms-mac'))) {
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13061
	fdwCharSet   = MAC_CHARSET;
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13062
#ifdef UNICODE_CHARSET
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13063
    } else if ((encoding == @symbol('ms-unicode'))) {
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13064
	fdwCharSet   = UNICODE_CHARSET;
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13065
#endif
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13066
    }
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13067
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 13068
    if ( __isStringLike( family ) ) {
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13069
	work = __stringVal( family );
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13070
	if (strcmp( work, "nil" ) != 0 ) {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13071
	    strncpy( faceName, work, sizeof(faceName)-1 );
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13072
	}
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13073
    }
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13074
4000
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 13075
    /* Q: should we allow those ? (they make ST/X programs less portable to X */
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 13076
    if( __isStringLike( weight ) ) {
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13077
	work = __stringVal( weight );
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13078
	if (strcmp( work, "bold" ) == 0 ) {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13079
	    fnWeight = FW_BOLD;
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13080
	} else if (strcmp( work, "medium" ) == 0 ) {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13081
	    fnWeight = FW_MEDIUM;
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13082
	} else if (strcmp( work, "normal" ) == 0 ) {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13083
	    fnWeight = FW_NORMAL;
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13084
	} else if (strcmp( work, "light" ) == 0 ) {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13085
	    fnWeight = FW_LIGHT;
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13086
	} else if (strcmp( work, "demi" ) == 0 ) {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13087
	    fnWeight = FW_LIGHT;
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13088
	} else if (strcmp( work, "heavy" ) == 0 ) {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13089
	    fnWeight = FW_HEAVY;
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13090
	} else if (strcmp( work, "extraBold" ) == 0 ) {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13091
	    fnWeight = FW_EXTRABOLD;
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13092
	} else if (strcmp( work, "semiBold" ) == 0 ) {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13093
	    fnWeight = FW_SEMIBOLD;
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13094
	} else if (strcmp( work, "thin" ) == 0 ) {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13095
	    fnWeight = FW_THIN;
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13096
	} else if (strcmp( work, "extraLight" ) == 0 ) {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13097
	    fnWeight = FW_EXTRALIGHT;
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13098
	}
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13099
    } else if (__isSmallInteger(weight)) {
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13100
	fnWeight = __intVal(weight);
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13101
    }
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13102
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13103
    if(__isSmallInteger( logSize )) {
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13104
	nHeight = __intVal( logSize );
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13105
    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13106
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 13107
    if (__isStringLike(slant)) {
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13108
	work2 = __stringVal( slant );
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13109
	work  = __stringVal( slant );
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13110
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13111
	if (strncmp(work2, "italic", 6) == 0)  {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13112
	    fdwItalic = TRUE;
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13113
	    if ( work2[6] == '-' )
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13114
		strncpy( work, &work2[7], ( strlen( work2) - 7) );
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13115
	} else {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13116
	    if (strncmp(work2, "oblique", 7) == 0)  {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13117
		fdwItalic = TRUE;
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13118
		if ( work2[7] == '-' )
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13119
		    strncpy( work, &work2[8], ( strlen( work2) - 8) );
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13120
	    }
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13121
	}
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13122
	if (strncmp( work, "underline", 9 ) == 0 ) {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13123
	    fdwUnderline = TRUE;
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13124
	    if( work[10] == '-' )
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13125
		strncpy( work2, &work[11], ( strlen( work ) - 10 ) );
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13126
	}
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13127
	if (strncmp( work2, "strikeOut", 9 ) == 0 ) {
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13128
	    fdwStrikeOut = TRUE;
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13129
	}
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13130
    }
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13131
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13132
    DPRINTF(("CreateFont face:%s h=%d w=%d wght=%d\n",
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13133
		faceName, nHeight, nWidth, fnWeight));
5190
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 13134
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 13135
    hFont = CreateFont(
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13136
			(
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13137
			    (heightIsCellHeight == true)  ?
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13138
				nHeight : -nHeight            /* positive:cell height; negative:character height */
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13139
			),
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13140
			nWidth,
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13141
			nEscapement,
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13142
			nOrientation,
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13143
			fnWeight,
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13144
			fdwItalic,
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13145
			fdwUnderline,
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13146
			fdwStrikeOut,
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13147
			fdwCharSet,
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13148
			fdwOutputPrecision,
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13149
			fdwClipPrecision,
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13150
			fdwQuality,
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13151
			fdwPitchAndFamily,
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13152
			faceName );
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13153
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 13154
    if (hFont != NULL) {
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13155
	DPRINTF(("createFont: %x\n", hFont));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13156
#ifdef COUNT_RESOURCES
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13157
	__cnt_font++;
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13158
	RES1PRINTF(("CreateFont %d\n", __cnt_font));
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13159
#endif
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13160
	RETURN ( __MKOBJ(hFont) );
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13161
    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13162
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13163
    DPRINTF(("***** ERROR createFontWithFoundry failed ERROR *****\n" ));
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13164
%}.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13165
    ^ nil
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13166
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13167
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13168
     Display getFontWithFoundry:'*'
5236
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13169
			 family:'courier'
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13170
			 weight:'medium'
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13171
			  slant:'r'
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13172
			spacing:nil
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13173
		      pixelSize:nil
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13174
			   size:13
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13175
		       registry:'iso8859'
c36d0e416566 WM_QUERYENDSESSION and WM_ENDSESSION events
Stefan Vogel <sv@exept.de>
parents: 5232
diff changeset
 13176
		       encoding:'*'
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13177
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13178
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13179
    "new NT Version: 20.2.1997 / 22:33:29 / dq"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13180
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13181
3972
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13182
getLogicalPixelSizeY
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13183
%{
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13184
    RETURN( __MKSMALLINT(__logPixelSY) );
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13185
%}
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13186
!
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13187
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13188
listOfAvailableFonts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13189
    "return a list with all available fonts on this display.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13190
     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
 13191
     next time. The elements of the returned collection are instances of
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13192
     FontDescription."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13193
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13194
    |list typeFaceList|
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13195
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13196
    listOfFonts notNil ifTrue:[^ listOfFonts].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13197
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13198
    list := OrderedCollection new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13199
    typeFaceList := OrderedCollection new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13200
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13201
    [
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13202
      self primEnumFontTypesInto:typeFaceList.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13203
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13204
      "/Transcript showCR:typeFaceList.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13205
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13206
      typeFaceList do:[:typeFace |
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13207
	  self primEnumFontsIn:typeFace into:list.
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13208
	  0
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13209
      ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13210
    ] valueUninterruptably.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13211
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13212
    "/ Transcript showCR:list.
2926
0f238dfe4207 italic font fix
Claus Gittinger <cg@exept.de>
parents: 2908
diff changeset
 13213
    listOfFonts := OrderedCollection new.
0f238dfe4207 italic font fix
Claus Gittinger <cg@exept.de>
parents: 2908
diff changeset
 13214
    list do:[:anInfoArray |
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13215
	| fntDescr italicFontDescr |
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13216
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13217
	fntDescr := self fontDescriptionFromLogicalFontInfoArray:anInfoArray.
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13218
	listOfFonts add:fntDescr.
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13219
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13220
	"/ manually generate italic version (any font can be made italic here)
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13221
	(fntDescr style startsWith:'roman') ifTrue:[
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13222
	    italicFontDescr := FontDescription
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13223
			    family:fntDescr family
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13224
			    face:fntDescr face
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13225
			    style:('italic' , (fntDescr style copyFrom:'roman' size+1))
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13226
			    size:fntDescr size
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13227
			    encoding:fntDescr encoding.
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13228
	    listOfFonts add:italicFontDescr.
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13229
	].
2926
0f238dfe4207 italic font fix
Claus Gittinger <cg@exept.de>
parents: 2908
diff changeset
 13230
    ].
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13231
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13232
    ^ listOfFonts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13233
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13234
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13235
     Display listOfAvailableFonts.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13236
     Display getAvailableFontsMatching:'*'.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13237
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13238
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13239
    "Modified: 27.9.1995 / 10:54:47 / stefan"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13240
    "Modified: 17.4.1996 / 15:27:57 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13241
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13242
5175
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13243
pixelSizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filterBlock
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13244
    "return a set of all available font pixel sizes in aFamily/aFace/aStyle on this display.
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13245
     Redefined to handle the special case of 0-size (which stands for any)"
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13246
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13247
    |sizes|
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13248
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13249
    sizes := super pixelSizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filterBlock.
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13250
    (sizes notNil and:[sizes includes:0]) ifTrue:[
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13251
	"special: size 0 means:
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13252
	 there are scaled versions in all sizes available"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13253
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13254
	^ #(6 8 10 12 13 14 15 16 18 20 22 24 28 32 48 64)
5175
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13255
    ].
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13256
    ^ sizes
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13257
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13258
    "
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13259
     Display pixelSizesInFamily:'courier' face:'bold' style:'roman'
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13260
    "
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13261
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13262
    "Created: 27.2.1996 / 01:38:15 / cg"
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13263
!
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13264
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13265
primEnumFontTypesInto:typeFaceList
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13266
%{
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13267
    if (__tmpDC) {
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13268
#ifdef USE_EnumFontFamiliesEx
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13269
	EnumFontFamiliesEx( __tmpDC, NULL, EnumFPTypeFaceProc, (DWORD)&(typeFaceList));
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13270
#else
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13271
	EnumFontFamilies( __tmpDC, NULL, EnumFPTypeFaceProc, (DWORD)&(typeFaceList));
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13272
#endif
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13273
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13274
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13275
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13276
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 13277
primEnumFontsIn:typeFace into:fontList
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13278
%{
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13279
    char *cp;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13280
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 13281
    if (__isStringLike(typeFace)) {
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13282
	if (__tmpDC) {
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13283
#ifdef USE_EnumFontFamiliesEx
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13284
	    EnumFontFamiliesEx(__tmpDC, __stringVal(typeFace), EnumFontsProc, (DWORD)&(fontList));
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13285
#else
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13286
	    EnumFontFamilies(__tmpDC, __stringVal(typeFace), EnumFontsProc, (DWORD)&(fontList));
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13287
#endif
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13288
	}
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13289
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13290
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13291
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13292
3481
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 13293
primFontMetricsOf:fontId intoArray:rawData
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13294
    "evaluate aBlock, passing a fonts metrics as arguments.
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13295
     fill passed array as:
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13296
      ascent     -> (data at:1)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13297
      descent    -> (data at:2)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13298
      maxAscent  -> (data at:3)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13299
      maxDescent -> (data at:4)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13300
      minWidth   -> (data at:5)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13301
      maxWidth   -> (data at:6)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13302
      avgWidth   -> (data at:7).
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13303
      minChar    -> (data at:8).
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13304
      maxChar    -> (data at:9).
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13305
      defaultChar-> (data at:10).
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13306
      charSet    -> (data at:11).
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13307
"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13308
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13309
%{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13310
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13311
    if (__isExternalAddress(fontId)
3481
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 13312
     && __isArray(rawData)
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13313
     && (__arraySize(rawData) >= 11)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13314
	SIZE size;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13315
	int avgWidth;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13316
	HGDIOBJ hFont;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13317
	HGDIOBJ prevFont;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13318
	TEXTMETRIC tmet;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13319
	static char *s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13320
	static int len;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13321
	OBJ t;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13322
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13323
	hFont = _HGDIOBJVal(fontId);
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13324
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13325
	/*
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13326
	 * temporarily set this font in the tmpDC (root-) context
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13327
	 */
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13328
#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
 13329
	if (__tmpDC_hfont != hFont) {
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13330
	    prevFont = SelectObject(__tmpDC, hFont);
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13331
	    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
 13332
		__tmpDC_prev_hfont = prevFont;
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13333
	    }
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13334
	    __tmpDC_hfont = hFont;
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13335
	}
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13336
#else
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13337
	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
 13338
#endif
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13339
	GetTextMetricsW(__tmpDC, &tmet);
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13340
	if (len == 0) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13341
	    len = strlen(s);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13342
	}
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13343
#if 0
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13344
	GetTextExtentPoint32(__tmpDC, s, len, &size);
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13345
	avgWidth = (size.cx / (len / 2) + 1) / 2;
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13346
#else
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13347
	avgWidth = tmet.tmAveCharWidth;
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13348
#endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13349
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13350
#ifndef CACHE_LAST_TMP_FONT
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13351
	SelectObject(__tmpDC, prevFont);
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13352
#endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13353
3481
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 13354
	__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
 13355
	__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
 13356
	__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
 13357
	__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
 13358
	__ArrayInstPtr(rawData)->a_element[4] = __MKSMALLINT(avgWidth);             /* minWidth   -> (data at:5) */
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 13359
	__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
 13360
	__ArrayInstPtr(rawData)->a_element[6] = __MKSMALLINT(avgWidth);             /* avgWidth   -> (data at:7) */
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13361
	__ArrayInstPtr(rawData)->a_element[7] = __MKSMALLINT(tmet.tmFirstChar);     /* min        -> (data at:8) */
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13362
	__ArrayInstPtr(rawData)->a_element[8] = __MKSMALLINT(tmet.tmLastChar);      /* max        -> (data at:9) */
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13363
	__ArrayInstPtr(rawData)->a_element[9] = __MKSMALLINT(tmet.tmDefaultChar);   /* default    -> (data at:10) */
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13364
	t = __charSetSymbolFor(tmet.tmCharSet);
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13365
	__ArrayInstPtr(rawData)->a_element[10]= t; __STORE(rawData, t);             /* charSet    -> (data at:11) */
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13366
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13367
	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
 13368
		    hFont, tmet.tmAscent, tmet.tmDescent, avgWidth, tmet.tmMaxCharWidth,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13369
		    tmet.tmAveCharWidth));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13370
	RETURN (self);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13371
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13372
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13373
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13374
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13375
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13376
releaseFont:aFontId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13377
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13378
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13379
    if (__isExternalAddress(aFontId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13380
	HGDIOBJ hFont = _HGDIOBJVal(aFontId);
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 13381
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 13382
	if (hFont) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13383
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13384
	    __cnt_font--;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13385
	   RES1PRINTF(("DestroyFont %d\n",__cnt_font));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13386
#endif
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 13387
	   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
 13388
	   _DeleteFont(hFont, __LINE__);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13389
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13390
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13391
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13392
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13393
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13394
sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13395
    "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
 13396
     on this display.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13397
     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
 13398
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13399
    |sizes|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13400
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13401
    sizes := super sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13402
    (sizes notNil and:[sizes includes:0]) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13403
	"special: in X11R5 and above, size 0 means:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13404
	 there are scaled versions in all sizes available"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13405
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13406
	^ #(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
 13407
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13408
    ^ sizes
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13409
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13410
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13411
     Display sizesInFamily:'courier' face:'bold' style:'roman'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13412
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13413
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13414
    "Created: 27.2.1996 / 01:38:15 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13415
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13416
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13417
widthOf:aString from:index1 to:index2 inFont:aFontId
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13418
    "leftover - bw compatibility"
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13419
    ^ self
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13420
	widthOf:aString from:index1 to:index2 inFont:aFontId
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13421
	in:nil with:nil
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13422
!
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13423
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13424
widthOf:aString from:index1 to:index2 inFont:aFontId in:ignoredDrawableId with:aGCId
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13425
%{  /* NOCONTEXT */
4729
037a913e50db umlaute with TextOutW fixed
Claus Gittinger <cg@exept.de>
parents: 4727
diff changeset
 13426
    unsigned char *cp;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13427
    int len, n, i1, i2, l;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13428
    OBJ cls;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13429
    int nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13430
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13431
    if (__bothSmallInteger(index1, index2)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13432
     && __isExternalAddress(aFontId)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13433
     && __isNonNilObject(aString)) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13434
	HGDIOBJ hFont,prevFont;
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13435
	HDC hDC;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13436
	SIZE tsize;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13437
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 13438
#define xxPRE_22_FEP_2007
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13439
#ifndef PRE_22_FEP_2007
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13440
#       define N_QUICK_CHARS    1024
4729
037a913e50db umlaute with TextOutW fixed
Claus Gittinger <cg@exept.de>
parents: 4727
diff changeset
 13441
	unsigned short quickWchars[N_QUICK_CHARS];
037a913e50db umlaute with TextOutW fixed
Claus Gittinger <cg@exept.de>
parents: 4727
diff changeset
 13442
	unsigned short *wcharPtr;
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13443
	int mustFree = 0;
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13444
	int i;
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13445
#endif
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13446
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13447
	hFont = _HGDIOBJVal(aFontId);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13448
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13449
	if (__isExternalAddress(aGCId)) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13450
	    struct gcData *gcData = _GCDATA(aGCId);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13451
	    hDC = _getDC(gcData);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13452
	    prevFont = SelectObject(hDC, hFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13453
	} else {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13454
	    hDC = __tmpDC;
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13455
#ifdef CACHE_LAST_TMP_FONT
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13456
	    if (__tmpDC_hfont != hFont) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13457
		prevFont = SelectObject(hDC, hFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13458
		if (__tmpDC_prev_hfont == NULL) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13459
		    __tmpDC_prev_hfont = prevFont;
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13460
		}
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13461
		__tmpDC_hfont = hFont;
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13462
	    }
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13463
#else
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13464
	    prevFont = SelectObject(hDC, hFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13465
#endif
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13466
	}
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13467
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13468
	i1 = __intVal(index1) - 1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13469
	cls = __qClass(aString);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13470
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13471
	if (i1 >= 0) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13472
	    i2 = __intVal(index2) - 1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13473
	    if (i2 < i1) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13474
		RETURN ( __MKSMALLINT( 0 ) );
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13475
	    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13476
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13477
	    cp = (char *) _stringVal(aString);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13478
	    l = i2 - i1 + 1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13479
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 13480
	    if (__isStringLike(aString)) {
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13481
		n = _stringSize(aString);
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13482
    commonWidthChars:
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13483
		if (i2 < n) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13484
		    cp += i1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13485
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13486
#ifdef PRE_22_FEP_2007
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13487
		    GetTextExtentPoint32(hDC, cp, l, &tsize);
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13488
#else
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13489
		    if (l <= N_QUICK_CHARS) {
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13490
			wcharPtr = quickWchars;
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13491
			mustFree = 0;
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13492
		    } else {
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13493
			wcharPtr = malloc(sizeof(short)*l);
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13494
			if (! wcharPtr) RETURN (__MKSMALLINT(0));
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13495
			mustFree = 1;
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13496
		    }
4729
037a913e50db umlaute with TextOutW fixed
Claus Gittinger <cg@exept.de>
parents: 4727
diff changeset
 13497
		    for (i=0; i<l; i++) wcharPtr[i] = ((unsigned char *)cp)[i];
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13498
		    GetTextExtentPoint32W(hDC, wcharPtr, l, &tsize);
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13499
		    if (mustFree) free(wcharPtr);
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13500
#endif
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13501
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13502
#ifdef SUPERDEBUG
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13503
		    if (__debug__) {
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13504
			char buf[80];
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13505
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13506
			GetTextFace(hDC,80,buf);
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13507
			console_printf("font1 %x %s >%s< l=%d dx=%d\n",hFont,buf,cp,l,tsize.cx);
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13508
		    }
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13509
#endif
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13510
		    if (__isExternalAddress(aGCId)) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13511
			SelectObject(hDC, prevFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13512
		    } else {
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13513
#ifndef CACHE_LAST_TMP_FONT
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13514
			SelectObject(hDC, prevFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13515
#endif
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13516
		    }
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13517
		    RETURN ( __MKSMALLINT(tsize.cx) );
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13518
		}
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13519
		RETURN (__MKSMALLINT(0));
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13520
	    }
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13521
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13522
	    nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13523
	    cp += nInstBytes;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13524
	    n = __byteArraySize(aString) - nInstBytes;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13525
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13526
	    if (__isBytes(aString)) {
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 13527
		goto commonWidthChars;
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13528
	    }
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13529
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13530
	    /* Unicode */
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13531
	    if (__isWords(aString)) {
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13532
		n = n / 2;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13533
		if (i2 < n) {
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13534
		    WIDECHAR *w_cp = (WIDECHAR *)cp;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13535
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13536
		    w_cp += i1;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13537
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13538
		    GetTextExtentPoint32W(hDC, w_cp, l, &tsize);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13539
		    if (__isExternalAddress(aGCId)) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13540
			SelectObject(hDC, prevFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13541
		    } else {
3493
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 13542
#ifndef CACHE_LAST_TMP_FONT
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13543
			SelectObject(hDC, prevFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13544
#endif
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13545
		    }
3493
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 13546
		    RETURN ( __MKSMALLINT(tsize.cx) );
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 13547
		}
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 13548
		RETURN (__MKSMALLINT(0));
3493
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 13549
	    }
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 13550
	}
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 13551
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13552
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13553
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13554
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13555
4511
4430c632995a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4504
diff changeset
 13556
!WinWorkstation methodsFor:'grabbing'!
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13557
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13558
allowEvents:mode
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13559
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13560
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13561
grabKeyboardIn:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13562
    "grab the keyboard"
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13563
%{
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13564
#ifdef NOT_YET_IMPLEMENTED
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13565
    if (__isExternalAddress(aWindowId)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13566
      HWND hWnd = _HWNDVal(aWindowId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13567
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13568
      CPRINTF(("grabKeyboard in %x\n",hWnd));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13569
    }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13570
#endif
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13571
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13572
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13573
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13574
grabPointerIn:aWindowId withCursor:aCursorId pointerMode:pMode keyboardMode:kMode confineTo:confineId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13575
    "grap the pointer - return true if ok"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13576
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13577
%{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13578
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13579
	HWND hWnd = _HWNDVal(aWindowId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13580
	HCURSOR hCursor = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13581
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13582
	if (__currentCapture != CAPTURE_NONE) {
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 13583
	    PostMessage(__currentPointerView, WM_THREAD_SETCAPTURE, 0, 0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13584
	    //ReleaseCapture();
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13585
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13586
#if 1
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13587
	/*
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13588
	 * place a special, invisible view above the root
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13589
	 */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13590
	if (hWnd == __rootWin) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13591
	    hWnd = __rootWinSpezial;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13592
	    ShowWindow(hWnd, SW_SHOWNOACTIVATE);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13593
	    //EnableWindow(hWnd,TRUE);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13594
	    SetWindowPos(hWnd, HWND_TOP,
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13595
			 0, 0, 0, 0,
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13596
			 SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13597
			 | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13598
	    CPRINTF(("setRootCapture %x\n",hWnd));
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13599
	}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13600
#endif
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13601
	if (__isExternalAddress(aCursorId)) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13602
	    hCursor = _HCURSORVal(aCursorId);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13603
	    CPRINTF(("grabPointerIn  SetCapture %x\n",hWnd));
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13604
	}
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 13605
	PostMessage(hWnd, WM_THREAD_SETCAPTURE, (INT)hWnd, (INT)hCursor);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13606
	RETURN (true);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13607
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13608
%}.
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13609
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13610
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13611
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13612
ungrabKeyboard
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13613
    "release the keyboard"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13614
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13615
    activeKeyboardGrab := nil.
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13616
%{
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13617
#ifdef NOT_YET_IMPLEMENTED
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13618
    CPRINTF(("ungrabKeyboard\n"));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13619
#endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13620
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13621
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13622
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13623
ungrabPointer
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13624
    "release the pointer"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13625
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13626
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13627
    CPRINTF(("ungrabPointer 1\n"));
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 13628
    PostThreadMessage(_dispatchThreadId, WM_THREAD_SETCAPTURE, 0, 0);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13629
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13630
    activePointerGrab := nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13631
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13632
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13633
!WinWorkstation methodsFor:'graphic context stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13634
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 13635
noClipIn:aWindowId gc:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13636
    "disable clipping rectangle"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13637
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13638
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13639
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 13640
    if (__isExternalAddress(aWindowId)
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13641
     && __isExternalAddress(aGCId)) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 13642
	struct gcData *gcData = _GCDATA(aGCId);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 13643
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 13644
	if (gcData->clipping != FALSE) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 13645
#ifdef GDIFLUSH_WHEN_CHANGING_CLIP
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 13646
	    GdiFlush();
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 13647
#endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 13648
	    gcData->clipping = FALSE;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 13649
#ifdef CACHE_LAST_DC
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 13650
	    if (lastGcData == gcData) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 13651
		SelectClipRgn(gcData->_hDC, NULL);
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 13652
	    }
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 13653
#endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 13654
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13655
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13656
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13657
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13658
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13659
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13660
setBackground:bgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13661
    "set background color to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13662
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13663
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13664
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 13665
    if (__isSmallInteger(bgColorIndex)
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13666
	&& __isExternalAddress(aGCId)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13667
	struct gcData *gcData = _GCDATA(aGCId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13668
	COLORREF bgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13669
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13670
	bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13671
	if (bgColor != gcData->bgColor) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13672
	    gcData->bgColor = bgColor;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 13673
#ifdef CACHE_LAST_DC
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13674
	    if (lastGcData == gcData) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13675
		SetBkColor(gcData->_hDC, bgColor);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13676
		/*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13677
		 * no need to flush pen - it does not depend upon
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13678
		 * the bg color
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13679
		 */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13680
	    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13681
#endif
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13682
	}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13683
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13684
	CPRINTF(("setBackground: %x\n", bgColor));
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13685
	RETURN (self);
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 13686
    }
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 13687
%}.
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 13688
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 13689
    ^self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13690
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13691
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13692
setBitmapMask:aBitmapId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13693
    "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
 13694
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13695
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13696
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 13697
    if (__isExternalAddress(aGCId)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 13698
	struct gcData *gcData = _GCDATA(aGCId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13699
	HBITMAP oldM;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13700
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13701
	oldM = gcData->hMask;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 13702
	if (__isExternalAddress(aBitmapId))
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 13703
	    gcData->hMask = _HBITMAPVAL(aBitmapId);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 13704
	else
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 13705
	    gcData->hMask = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 13706
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13707
	if (oldM != gcData->hMask) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13708
	    FLUSH_CACHED_DC(gcData);
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 13709
	    CPRINTF(("masks set to %x\n",gcData->hMask));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13710
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13711
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13712
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13713
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13714
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13715
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
 13716
setClipByChildren:aBool in:aWindowId gc:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13717
    "enable/disable drawing into child views"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13718
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13719
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13720
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 13721
    if (ISCONNECTED && __isExternalAddress(aGCId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13722
	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
 13723
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 13724
	if (gcData && gcData->hWnd) {
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13725
	    int newClip;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13726
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 13727
	   newClip = (aBool == true) ? TRUE : FALSE;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13728
	    if (newClip != gcData->clipByChildren) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 13729
#ifdef GDIFLUSH_WHEN_CHANGING_CLIP
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 13730
		GdiFlush();
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 13731
#endif
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13732
		/* set/clear clip by children */
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13733
		gcData->clipByChildren = newClip;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13734
		FLUSH_CACHED_DC(gcData);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13735
	    }
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
 13736
	} else {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13737
	    DPRINTF(("clipping by child failed - invalid window\n" ));
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
 13738
	}
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
 13739
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13740
%}.
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 13741
    ^ self
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13742
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13743
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 13744
setClipX:clipX y:clipY width:clipWidth height:clipHeight in:ignoredDrawableId gc:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13745
    "clip to a rectangle"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13746
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 13747
"
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 13748
      p--w---
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 13749
      |     |
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 13750
      h     |  the clipping rectangle
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 13751
      |     |
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 13752
      -------
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 13753
	  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
 13754
"
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 13755
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13756
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13757
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 13758
    if (  __isExternalAddress(aGCId)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 13759
       && __bothSmallInteger(clipX, clipY)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 13760
       && __bothSmallInteger(clipWidth, clipHeight) ) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 13761
	struct gcData *gcData = _GCDATA(aGCId);
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13762
	int cX, cY, cW, cH;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13763
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13764
	cX = __intVal(clipX);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13765
	cY = __intVal(clipY);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13766
	cW = __intVal(clipWidth);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13767
	cH = __intVal(clipHeight);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13768
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13769
	if ((gcData->clipping != TRUE)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13770
	 || (cX != gcData->clipX)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13771
	 || (cY != gcData->clipY)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13772
	 || (cW != gcData->clipW)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13773
	 || (cH != gcData->clipH)) {
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13774
	    gcData->clipping = TRUE;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13775
	    gcData->clipX = cX;
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13776
	    gcData->clipY = cY;
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13777
	    gcData->clipW = cW;
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13778
	    gcData->clipH = cH;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13779
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 13780
#ifdef GDIFLUSH_WHEN_CHANGING_CLIP
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 13781
	    GdiFlush();
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 13782
#endif
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13783
#ifdef CACHE_LAST_DC
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 13784
	    /*
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 13785
	     * must update current cached DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 13786
	     */
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13787
	    if (lastGcData == gcData) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13788
		HRGN region = CreateRectRgn(cX, cY, cX + cW, cY + cH);
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13789
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13790
		if (region == NULL ) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 13791
		    console_fprintf(stderr, "WinWorkstat [warning]: clipping region creation failed\n");
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13792
		    FLUSH_CACHED_DC(gcData);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13793
		} else {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13794
		    if (SelectClipRgn(gcData->_hDC, region) == ERROR ) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 13795
			console_fprintf(stderr, "WinWorkstat [warning]: select clipping region failed\n");
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13796
			FLUSH_CACHED_DC(gcData);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13797
		    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13798
		    _DeleteObject(region, __LINE__);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13799
		}
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13800
	    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13801
#endif
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 13802
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13803
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13804
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13805
%}
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
setDashes:dashList dashOffset:offset in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13809
    "set line attributes"
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
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13813
    if (__isExternalAddress(aGCId)) {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 13814
	PRINTF(("WinWorkstat [warning]: dashes not (yet) implemented\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13815
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13816
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13817
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13818
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13819
setFont:aFontId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13820
    "set font to be drawn in"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13821
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13822
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13823
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13824
    if (__isExternalAddress(aGCId)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 13825
     && __isExternalAddress(aFontId))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 13826
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13827
	struct gcData *gcData = _GCDATA(aGCId);
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13828
	HGDIOBJ prevFont, hFont;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13829
	TEXTMETRIC tmet;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13830
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13831
	hFont = _HGDIOBJVal(aFontId);
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13832
	if (gcData->hFont != hFont) {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13833
	    gcData->hFont = hFont;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13834
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13835
#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
 13836
	    if (__tmpDC_hfont != hFont) {
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13837
		prevFont = SelectObject(__tmpDC, hFont);
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13838
		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
 13839
		    __tmpDC_prev_hfont = prevFont;
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13840
		}
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13841
		__tmpDC_hfont = hFont;
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13842
	    }
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13843
#else
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13844
	    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
 13845
#endif
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13846
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13847
	    GetTextMetrics(__tmpDC, &tmet);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13848
	    gcData->fontAscent = tmet.tmAscent;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13849
#ifdef SUPERDEBUG
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13850
	    if (__debug__) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13851
		char buf[80];
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13852
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13853
		GetTextFace(__tmpDC, 80, buf);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13854
		PRINTF(("setFont: %x %s\n", hFont, buf));
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13855
	    }
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13856
#endif
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13857
#ifndef CACHE_LAST_TMP_FONT
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13858
	    SelectObject(__tmpDC, prevFont);
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13859
#endif
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13860
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 13861
#ifdef CACHE_LAST_DC
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 13862
	    /*
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 13863
	     * must update current cached DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 13864
	     */
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13865
	    if (lastGcData == gcData) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13866
		prevFont = SelectObject(gcData->_hDC, hFont);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13867
		if (! gcData->save_hFont) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13868
		    gcData->save_hFont = prevFont;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13869
		}
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13870
	    }
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13871
#endif
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13872
	    RETURN ( self );
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13873
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13874
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13875
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13876
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13877
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13878
setForeground:fgColorIndex background:bgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13879
    "set foreground and background colors to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13880
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13881
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13882
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 13883
    if (__bothSmallInteger(fgColorIndex, bgColorIndex)
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13884
	&& __isExternalAddress(aGCId)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13885
	struct gcData *gcData = _GCDATA(aGCId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13886
	COLORREF fg, bg, oldFg, oldBg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13887
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13888
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13889
	bg = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13890
	oldFg = gcData->fgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13891
	oldBg = gcData->bgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13892
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13893
	if ((fg != oldFg) || (bg != oldBg)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13894
	    gcData->fgColor = fg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13895
	    gcData->bgColor = bg;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 13896
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 13897
#ifdef CACHE_LAST_DC
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13898
	    /*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13899
	     * must update or flush current cached DC
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13900
	     */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13901
	    if (lastGcData == gcData) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13902
		/* Pen only depends upon fg-color */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13903
		if (fg != oldFg) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13904
		    SetTextColor(gcData->_hDC, fg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13905
		    FLUSH_CACHED_PEN(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13906
		}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13907
		if (bg != oldBg) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13908
		    SetBkColor(gcData->_hDC, bg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13909
		}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13910
		FLUSH_CACHED_BRUSH(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13911
	    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13912
#endif
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13913
	    CPRINTF(("setForeground: %x background: %x\n", gcData->fgColor, gcData->bgColor));
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13914
	}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13915
	RETURN (self);
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 13916
    }
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 13917
%}.
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 13918
    ^self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13919
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13920
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13921
setForeground:fgColorIndex background:bgColorIndex mask:aBitmapId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13922
    "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
 13923
     solid (if aBitmapId is nil)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13924
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13925
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13926
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 13927
    if (__bothSmallInteger(fgColorIndex, bgColorIndex)
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13928
	&& __isExternalAddress(aGCId)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13929
	struct gcData *gcData = _GCDATA(aGCId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13930
	COLORREF fg, bg, oldFg, oldBg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13931
	HBITMAP m, oldM;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13932
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13933
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13934
	bg = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13935
	if (__isExternalAddress(aBitmapId))
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13936
	    m = _HBITMAPVAL(aBitmapId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13937
	else
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13938
	    m = 0;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13939
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13940
	oldFg = gcData->fgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13941
	oldBg = gcData->bgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13942
	oldM = gcData->hMask;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13943
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13944
	if ((oldFg != fg) || (oldBg != bg) || (oldM != m)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13945
	    gcData->fgColor = fg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13946
	    gcData->bgColor = bg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13947
	    gcData->hMask = m;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 13948
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 13949
#ifdef CACHE_LAST_DC
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13950
	    /*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13951
	     * must update or flush current cached DC
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13952
	     */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13953
	    if (lastGcData == gcData) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13954
		if (oldM == m) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13955
		    /*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13956
		     * only fg/bg changed
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13957
		     */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13958
		    /* Pen only depends upon fg-color */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13959
		    if (fg != oldFg) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13960
			SetTextColor(gcData->_hDC, fg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13961
			FLUSH_CACHED_PEN(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13962
		    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13963
		    if (bg != oldBg) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13964
			SetBkColor(gcData->_hDC, bg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13965
		    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13966
		    FLUSH_CACHED_BRUSH(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13967
		} else {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13968
		    _releaseDC(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13969
		}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13970
	    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13971
#endif
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13972
	    CPRINTF(("setForeground: %x background: %x mask: %x\n", gcData->fgColor, gcData->bgColor,gcData->hMask));
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13973
	}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13974
	RETURN (self);
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 13975
    }
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 13976
%}.
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 13977
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 13978
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13979
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13980
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 13981
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
 13982
    "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
 13983
     solid (if aBitmapId is nil); also set lineWidth"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13984
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13985
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13986
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 13987
    if (__bothSmallInteger(fgColorIndex, bgColorIndex)
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13988
	&& __isSmallInteger(aLineWidth)
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13989
	&& __isExternalAddress(aGCId)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13990
	struct gcData *gcData = _GCDATA(aGCId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13991
	COLORREF fg, bg, oldFg, oldBg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13992
	HBITMAP m, oldM;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13993
	int lw, oldLw;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13994
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13995
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13996
	bg = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13997
	if (__isExternalAddress(aBitmapId))
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13998
	    m = _HBITMAPVAL(aBitmapId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 13999
	else
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14000
	    m = 0;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14001
	lw = __intVal(aLineWidth);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14002
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14003
	oldFg = gcData->fgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14004
	oldBg = gcData->bgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14005
	oldLw = gcData->lineWidth;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14006
	oldM = gcData->hMask;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14007
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14008
	if ((oldFg != fg) || (oldBg != bg)
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14009
	 || (oldLw != lw) || (oldM != m)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14010
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14011
	    gcData->fgColor = fg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14012
	    gcData->bgColor = bg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14013
	    gcData->lineWidth = lw;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14014
	    gcData->hMask = m;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14015
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14016
#ifdef CACHE_LAST_DC
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14017
	    /*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14018
	     * must update or flush current cached DC
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14019
	     */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14020
	    if (lastGcData == gcData) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14021
		if ((oldM == m) && (oldLw == lw)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14022
		    /*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14023
		     * only fg/bg changed
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14024
		     */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14025
		    /* Pen only depends upon fg-color */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14026
		    if (fg != oldFg) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14027
			SetTextColor(gcData->_hDC, fg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14028
			FLUSH_CACHED_PEN(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14029
		    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14030
		    if (bg != oldBg) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14031
			SetBkColor(gcData->_hDC, bg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14032
		    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14033
		    FLUSH_CACHED_BRUSH(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14034
		} else {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14035
		    _releaseDC(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14036
		}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14037
	    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14038
#endif
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14039
	    CPRINTF(("setForeground: %x background: %x mask: %x linewidth: %d\n",
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14040
			gcData->fgColor, gcData->bgColor,
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14041
			gcData->hMask, gcData->lineWidth));
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14042
	}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14043
	RETURN (self);
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14044
    }
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14045
%}.
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14046
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14047
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14048
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14049
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14050
setForeground:fgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14051
    "set foreground color to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14052
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14053
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14054
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14055
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14056
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14057
    if (__isSmallInteger(fgColorIndex)
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14058
	&& __isExternalAddress(aGCId)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14059
	struct gcData *gcData = _GCDATA(aGCId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14060
	COLORREF fg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14061
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14062
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14063
	if (fg != gcData->fgColor) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14064
	    gcData->fgColor = fg;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14065
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14066
#ifdef CACHE_LAST_DC
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14067
	    /*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14068
	     * must update or flush current cached DC
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14069
	     */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14070
	    if (lastGcData == gcData) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14071
		/* Pen depends upon fg-color */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14072
		SetTextColor(gcData->_hDC, fg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14073
		FLUSH_CACHED_PEN(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14074
		FLUSH_CACHED_BRUSH(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14075
	    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14076
#endif
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14077
	    CPRINTF(("setForeground: %x\n", gcData->fgColor));
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14078
	}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14079
	RETURN (self);
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14080
    }
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14081
%}.
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14082
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14083
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14084
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14085
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14086
setFunction:aFunctionSymbol in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14087
    "set alu function to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14088
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14089
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14090
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14091
    if (__isExternalAddress(aGCId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14092
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14093
	int fun = -1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14094
	int bfun = -1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14095
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14096
	if (aFunctionSymbol == @symbol(copy)) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14097
	    fun = R2_COPYPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14098
	    bfun = BITBLT_COPY;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14099
	} else if (aFunctionSymbol == @symbol(copyInverted)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14100
	    fun = R2_NOTCOPYPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14101
	    bfun = BITBLT_COPYINVERTED;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14102
	} else if (aFunctionSymbol == @symbol(xor)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14103
	    fun = R2_XORPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14104
	    bfun = BITBLT_XOR;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14105
	} else if (aFunctionSymbol == @symbol(and)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14106
	    fun = R2_MASKPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14107
	    bfun = BITBLT_AND;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14108
	} else if (aFunctionSymbol == @symbol(or)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14109
	    fun = R2_MERGEPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14110
	    bfun = BITBLT_OR;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14111
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14112
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14113
	if (fun != -1) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14114
#if 0
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14115
	    console_printf("set func to");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14116
	    switch (bfun) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14117
		case BITBLT_COPY:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14118
		    console_printf("BITBLT_COPY\n");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14119
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14120
		case BITBLT_COPYINVERTED:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14121
		    console_printf("BITBLT_COPYINVERTED\n");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14122
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14123
		case BITBLT_XOR:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14124
		    console_printf("BITBLT_XOR\n");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14125
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14126
		case BITBLT_AND:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14127
		    console_printf("BITBLT_AND\n");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14128
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14129
		case BITBLT_OR:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14130
		    console_printf("BITBLT_OR\n");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14131
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14132
	    }
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14133
#endif
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14134
	} else {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14135
	    INFOFPRINTF( (stderr, "WinWorkstat [warning]: unsuported Rasterfunction\n") );
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14136
	    fun = R2_COPYPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14137
	    bfun = BITBLT_COPY;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14138
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14139
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14140
	if ((fun != gcData->rop2)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14141
	 || (bfun != gcData->bitbltrop2)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14142
	    gcData->rop2 = fun;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14143
	    gcData->bitbltrop2 = bfun;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14144
#ifdef CACHE_LAST_DC
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14145
	    /*
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14146
	     * must update current cached DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14147
	     */
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14148
	    if (gcData == lastGcData) {
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14149
		SetROP2(gcData->_hDC, fun);
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14150
	    }
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14151
#endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14152
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14153
    } else {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14154
	INFOFPRINTF((stderr, "WinWorkstation [warning]: Rasterfunction no GC\n"));
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14155
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14156
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14157
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14158
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14159
setGraphicsExposures:aBoolean in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14160
    "set or clear the graphics exposures flag"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14161
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14162
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14163
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14164
setLineWidth:aNumber style:lineStyle cap:capStyle join:joinStyle in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14165
    "set line attributes"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14166
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14167
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14168
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14169
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14170
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14171
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14172
     && __isSmallInteger(aNumber)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14173
	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
 14174
	int style;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14175
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14176
	gcData->lineWidth = __intVal(aNumber);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14177
	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
 14178
	    style = PS_SOLID;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14179
	} 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
 14180
	    style= PS_DASH;
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 14181
	} 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
 14182
	    style= PS_DOT;
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 14183
	} 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
 14184
	    style= PS_DASHDOT;
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 14185
	} 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
 14186
	    style= PS_DASHDOTDOT;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14187
	} else
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14188
	    style= PS_SOLID;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14189
	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
 14190
	gcData->lStyle |= style;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14191
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14192
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14193
	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
 14194
	    style = PS_ENDCAP_ROUND;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14195
	} 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
 14196
	    style = PS_ENDCAP_SQUARE;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14197
	} 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
 14198
	    style = PS_ENDCAP_FLAT;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14199
	} else
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14200
	    style = PS_ENDCAP_FLAT;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14201
	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
 14202
	gcData->lStyle |= style;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14203
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14204
	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
 14205
	    style = PS_JOIN_BEVEL;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14206
	} 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
 14207
	    style = PS_JOIN_MITER;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14208
	} 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
 14209
	    style = PS_JOIN_ROUND;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14210
	} else
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14211
	    style = PS_JOIN_MITER;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14212
	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
 14213
	gcData->lStyle |= style;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14214
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14215
	FLUSH_CACHED_DC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14216
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14217
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14218
%}
2232
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
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14221
setMaskOriginX:orgX y:orgY in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14222
    "set the mask origin"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14223
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14224
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14225
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14226
    if (__isExternalAddress(aGCId)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14227
     && __bothSmallInteger(orgX,orgY)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14228
	struct gcData *gcData = _GCDATA(aGCId);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14229
	int oX, oY;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14230
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14231
	oX = __intVal(orgX);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14232
	oY = __intVal(orgY);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14233
	if ((oX != gcData->maskOrgX)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14234
	 || (oY != gcData->maskOrgY)) {
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14235
	    gcData->maskOrgX = __intVal(orgX);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14236
	    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
 14237
	    FLUSH_CACHED_DC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14238
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14239
	RETURN (self);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14240
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14241
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14242
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14243
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14244
setPixmapMask:aPixmapId in:aGCId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14245
    "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
 14246
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14247
%{  /* NOCONTEXT */
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14248
    if (__isExternalAddress(aGCId)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14249
	struct gcData *gcData = _GCDATA(aGCId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14250
	HBITMAP oldM;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14251
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14252
	oldM = gcData->hMask;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14253
	if (__isExternalAddress(aPixmapId))
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14254
	    gcData->hMask = _HBITMAPVAL(aPixmapId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14255
	else
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14256
	    gcData->hMask = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14257
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14258
	if (oldM != gcData->hMask) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14259
	    FLUSH_CACHED_DC(gcData);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14260
	    DPRINTF(("PixmapMasks set to %x\n",gcData->hMask));
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14261
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14262
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14263
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14264
%}
2232
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
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14267
!WinWorkstation methodsFor:'initialize / release'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14268
4916
10e7ece60c50 Handle numeric keypad keys with NumLock pressed
Stefan Vogel <sv@exept.de>
parents: 4906
diff changeset
 14269
closeConnection
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14270
    "close down the connection to the display"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14271
4916
10e7ece60c50 Handle numeric keypad keys with NumLock pressed
Stefan Vogel <sv@exept.de>
parents: 4906
diff changeset
 14272
"/    Processor disableSemaphore:eventSema
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14273
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14274
3832
85b5220f7ade *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3828
diff changeset
 14275
initializeDefaultKeyboardMappingsIn:aKeyboardMap
4916
10e7ece60c50 Handle numeric keypad keys with NumLock pressed
Stefan Vogel <sv@exept.de>
parents: 4906
diff changeset
 14276
10e7ece60c50 Handle numeric keypad keys with NumLock pressed
Stefan Vogel <sv@exept.de>
parents: 4906
diff changeset
 14277
    #(
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14278
	Copy            Ctrlc           "copy selection to buffer"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14279
	Cut             Ctrlx           "cut selection into buffer"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14280
	Paste           Ctrlv           "paste buffer or external selection"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14281
	UserAbort       CtrlCancel      "Abort window process"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14282
	UserInterrupt   Pause           "interrupt window process"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14283
	$0              KeyPad0         "NumLocked numeric keypad keys..."
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14284
	$1              KeyPad1
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14285
	$2              KeyPad2
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14286
	$3              KeyPad3
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14287
	$4              KeyPad4
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14288
	$5              KeyPad5
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14289
	$6              KeyPad6
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14290
	$7              KeyPad7
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14291
	$8              KeyPad8
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14292
	$9              KeyPad9
4916
10e7ece60c50 Handle numeric keypad keys with NumLock pressed
Stefan Vogel <sv@exept.de>
parents: 4906
diff changeset
 14293
    ) pairWiseDo:[:eachMapping :eachKey|
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14294
	    aKeyboardMap
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14295
		bindValue:eachMapping to:eachKey.
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14296
	].
5108
5c92e9b267db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5088
diff changeset
 14297
5c92e9b267db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5088
diff changeset
 14298
    "
5c92e9b267db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5088
diff changeset
 14299
     Screen default initializeDefaultKeyboardMappingsIn:Screen default keyboardMap
4916
10e7ece60c50 Handle numeric keypad keys with NumLock pressed
Stefan Vogel <sv@exept.de>
parents: 4906
diff changeset
 14300
    "
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 14301
!
3832
85b5220f7ade *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3828
diff changeset
 14302
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14303
initializeDefaultValues
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 14304
    focusMode := #activeWindow.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 14305
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 14306
"/    self activateOnClick:true.
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 14307
"/    self ignoreButtonPressOnActivate:false.
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 14308
"/    self rightButtonIsLowerWindow:true.
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 14309
"/    self shiftedLeftButtonIsLowerWindow:true.
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 14310
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14311
    buttonTranslation := ButtonTranslation.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14312
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14313
    self initializeModifierMappings
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14314
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14315
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 14316
initializeDevice
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14317
%{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14318
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14319
    int scr;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14320
    int maxRGBDepth;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14321
    int rgbRedMask, rgbGreenMask, rgbBlueMask;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14322
    int nvi, i;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14323
    char *type, *nm;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14324
    int dummy;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14325
    int mask, shift, nBits;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14326
    HDC _rootDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14327
    OBJ id;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14328
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14329
    if (firstInstance) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14330
	OSVERSIONINFO osvi;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14331
	WNDCLASS wc;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14332
	firstInstance = 0;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14333
	DPRINTF(("first create - registerClass\n"));
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14334
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14335
	memset(&osvi, 0, sizeof(OSVERSIONINFO));
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14336
	osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14337
	GetVersionEx (&osvi);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14338
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14339
	__INST(isWin95) = __INST(isWinXP) = false;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14340
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14341
	switch (osvi.dwMajorVersion) {
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14342
	    default:
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14343
		__isWinNT = 1;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14344
		__isWinXP = 1;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14345
		__isWinVista = 1;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14346
		__INST(isWinXP) = true;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14347
		break;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14348
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14349
	    case 6:
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14350
		// vista, longhorn
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14351
		__isWinNT_NEW_BEHAVIOUR = 1;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14352
		__isWinNT = 1;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14353
		__isWinXP = 1;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14354
		__isWinVista = 1;
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14355
		__INST(isWinXP) = true;
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14356
		break;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14357
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14358
	    case 5:
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14359
		// 2k, xp and 2003
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14360
		__isWinNT_NEW_BEHAVIOUR = 1;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14361
		__isWinNT = 1;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14362
		if (osvi.dwMinorVersion >= 1) {
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14363
		    if (osvi.dwMinorVersion >= 2) {
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14364
			// windows server 2003
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14365
		    }
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14366
		    __INST(isWinXP) = true;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14367
		    __isWinXP = 1;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14368
		} else {
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14369
		    __isWin2k = 1;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14370
		}
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14371
		break;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14372
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14373
	    case 4:
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14374
		// nt4.0
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14375
		__isWinNT_NEW_BEHAVIOUR = 1;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14376
	    case 3:
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14377
		// nt3.51
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14378
		__isWinNT = 1;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14379
		break;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14380
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14381
	    // actually: no longer supported
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14382
	    case 2:
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14383
	    case 1:
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14384
	    case 0:
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14385
		__isWin95 = 1;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14386
		__INST(isWin95) = true;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14387
		break;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14388
	}
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14389
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14390
	if (! __isWin95 ) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14391
	    NUM_PEN_CACHED = NUM_PEN_CACHED_NT;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14392
	    NUM_BRUSH_CACHED = NUM_BRUSH_CACHED_NT;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14393
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14394
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14395
	/*
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14396
	 * register class: ST/X
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14397
	 */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14398
	wc.style = 0
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14399
		   /* | CS_OWNDC */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14400
		   /* | CS_HREDRAW */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14401
		   /* | CS_VREDRAW */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14402
		  | CS_DBLCLKS;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14403
	wc.lpfnWndProc = (WNDPROC) MainWndProc;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14404
	wc.cbClsExtra = 0;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14405
	wc.cbWndExtra = N_WINDOW_PRIVATE;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14406
	wc.hInstance = (HANDLE) __getHInstance();
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14407
	wc.hIcon = NULL;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14408
	wc.hCursor = 0;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14409
	wc.hbrBackground = 0;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14410
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14411
	wc.lpszMenuName =  NULL;
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14412
	wc.lpszClassName = wapp_name;
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14413
	if (! RegisterClassW(&wc)) {
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14414
	    DPRINTF(("RegisterClassW failed\n"));
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14415
	}
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14416
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14417
	/*
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14418
	 * register class: ST/X:Root
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14419
	 */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14420
	wc.style = 0;
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14421
	wc.lpfnWndProc = (WNDPROC) MainWndProc;
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14422
	wc.cbClsExtra = 0;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14423
	wc.cbWndExtra = N_WINDOW_PRIVATE;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14424
	wc.hInstance = (HANDLE) __getHInstance();
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14425
	wc.hIcon = NULL;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14426
	wc.hCursor = 0;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14427
	wc.hbrBackground = GetStockObject(HOLLOW_BRUSH);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14428
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14429
	wc.lpszMenuName =  NULL;
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14430
	wc.lpszClassName = wapp_nameRoot;
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14431
	if (! RegisterClassW(&wc)) {
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14432
	    DPRINTF(("RegisterClassW failed\n"));
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14433
	}
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14434
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14435
	/*
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14436
	 * register class: ST/X:Popup
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14437
	 */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14438
	wc.style = CS_SAVEBITS;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14439
	if (__isWinXP) {
3714
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 14440
#ifndef CS_DROPSHADOW
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 14441
# define CS_DROPSHADOW    0x020000
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 14442
#endif
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14443
	    wc.style |= CS_DROPSHADOW;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14444
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14445
	wc.lpfnWndProc = (WNDPROC) MainWndProc;;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14446
	wc.cbClsExtra = 0;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14447
	wc.cbWndExtra = N_WINDOW_PRIVATE;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14448
	wc.hInstance = (HANDLE) __getHInstance();
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14449
	wc.hIcon = NULL;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14450
	wc.hCursor = 0;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14451
	wc.hbrBackground = GetStockObject(HOLLOW_BRUSH);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14452
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14453
	wc.lpszMenuName =  NULL;
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14454
	wc.lpszClassName = wapp_namePopup;
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14455
	if (! RegisterClassW(&wc)) {
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14456
	    DPRINTF(("RegisterClassW failed\n"));
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14457
	}
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14458
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14459
	/*
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14460
	 * register class: ST/X:Dialog
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14461
	 */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14462
	wc.style = CS_SAVEBITS;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14463
	wc.lpfnWndProc = (WNDPROC) MainWndProc;;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14464
	wc.cbClsExtra = 0;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14465
	wc.cbWndExtra = N_WINDOW_PRIVATE;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14466
	wc.hInstance = (HANDLE) __getHInstance();
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14467
	wc.hIcon = NULL;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14468
	wc.hCursor = 0;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14469
	wc.hbrBackground = GetStockObject(HOLLOW_BRUSH);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14470
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14471
	wc.lpszMenuName =  NULL;
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14472
	wc.lpszClassName = wapp_nameDialog;
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14473
	if (! RegisterClassW(&wc)) {
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14474
	    DPRINTF(("RegisterClassW failed\n"));
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 14475
	}
5072
fcd3884582e0 unicode stuff
Claus Gittinger <cg@exept.de>
parents: 5067
diff changeset
 14476
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14477
	/*
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14478
	 * generate my events
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14479
	 */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14480
	hDispatchThreadRunningEvent = CreateEvent(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14481
				NULL,            /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14482
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14483
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14484
				"DispatchThreadRunning"); /* name of event */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14485
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14486
	if (hDispatchThreadRunningEvent == NULL) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14487
	    console_fprintf(stderr, "WinWorkstation [fatal]: CreateEvent-0 failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14488
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14489
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14490
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14491
	hNeverTriggered = CreateEvent(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14492
				NULL,            /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14493
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14494
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14495
				"Never");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14496
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14497
	if (hNeverTriggered == NULL) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14498
	    console_fprintf(stderr, "WinWorkstation [fatal]: CreateEvent-1 failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14499
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14500
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14501
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14502
	hCreateEvent = CreateEvent(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14503
				NULL,            /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14504
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14505
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14506
				"CreateEvents"); /* name of event */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14507
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14508
	if (hCreateEvent == NULL) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14509
	    console_fprintf(stderr, "WinWorkstation [fatal]: CreateEvent-2 failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14510
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14511
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14512
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14513
	hInputEvent = CreateEvent(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14514
				NULL,            /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14515
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14516
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14517
				"InputEvents");  /* name of event */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14518
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14519
	if (hInputEvent == NULL) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14520
	    console_fprintf(stderr, "WinWorkstation [fatal]: CreateEvent-3 failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14521
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14522
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14523
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14524
	if (hEventsMutex) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14525
	    console_fprintf(stderr, "WinWorkstation [fatal]: hEventsMutex already created\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14526
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14527
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14528
	hEventsMutex = CreateMutex(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14529
				NULL,            /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14530
				FALSE,           /* initially not owned */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14531
				"EventsMutex");  /* name of mutex */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14532
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14533
	if (! hEventsMutex) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14534
	    console_fprintf(stderr, "WinWorkstation [fatal]: hEventsMutex failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14535
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14536
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14537
	DuplicateHandle(GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14538
			hEventsMutex,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14539
			GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14540
			&hEventsMutex,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14541
			DUPLICATE_SAME_ACCESS,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14542
			FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14543
			DUPLICATE_SAME_ACCESS);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14544
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 14545
#ifdef USE_PAINT_MUTEX
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14546
	hPaintMutex = CreateMutex(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14547
				NULL,           /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14548
				FALSE,          /* initially not owned */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14549
				"PaintMutex");  /* name of mutex */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14550
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14551
	if (hPaintMutex == NULL) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14552
	    console_fprintf(stderr, "WinWorkstation [fatal]: CreateMutex(PaintMutex) failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14553
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14554
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14555
	DuplicateHandle(GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14556
			hPaintMutex,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14557
			GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14558
			&hPaintMutex,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14559
			DUPLICATE_SAME_ACCESS,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14560
			FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14561
			DUPLICATE_SAME_ACCESS);
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 14562
#endif
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 14563
#ifdef USE_DRAW_MUTEX
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14564
	hDrawMutex = CreateMutex(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14565
				NULL,           /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14566
				FALSE,          /* initially not owned */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14567
				"DrawMutex");   /* name of mutex */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14568
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14569
	if (hDrawMutex == NULL) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14570
	    console_fprintf(stderr, "WinWorkstation [fatal]: CreateMutex(DrawMutex) failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14571
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14572
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14573
	DuplicateHandle(GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14574
			hDrawMutex,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14575
			GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14576
			&hDrawMutex,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14577
			DUPLICATE_SAME_ACCESS,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14578
			FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14579
			DUPLICATE_SAME_ACCESS);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14580
#endif
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14581
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14582
	_masterThreadId = GetCurrentThreadId();
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
 14583
#ifndef WIN32THREADS
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14584
	DuplicateHandle(GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14585
			GetCurrentThread(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14586
			GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14587
			&_masterThread,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14588
			DUPLICATE_SAME_ACCESS,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14589
			FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14590
			DUPLICATE_SAME_ACCESS);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14591
#endif
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14592
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14593
	initEventqueue();
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14594
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14595
	/*
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14596
	 * start the event dispatcher thread and wait for it to
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14597
	 * be ready
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14598
	 */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14599
	CreateThread((LPSECURITY_ATTRIBUTES)0,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14600
		     EVENT_THREAD_STACKSIZE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14601
		     (LPTHREAD_START_ROUTINE)dispatchThread,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14602
		     0, 0, &_dispatchThreadId);
4713
199dbf1a1406 changed #initializeDevice - call CreateThread instead of beginthreadNT
Stefan Vogel <sv@exept.de>
parents: 4712
diff changeset
 14603
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
 14604
#ifdef STARTUP_DISPATCHTHREAD_DEBUG
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14605
	console_fprintf(stderr, "WinWorkstation [info]: dispatchThreadId=%x\n", _dispatchThreadId);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14606
#endif
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14607
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14608
	if (WaitForSingleObject(hDispatchThreadRunningEvent, 5000L) != WAIT_OBJECT_0) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14609
	    console_fprintf(stderr, "WinWorkstation [error]: oops - timeout waiting for eventThread to start\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14610
	}
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
 14611
#ifdef STARTUP_DISPATCHTHREAD_DEBUG
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14612
	console_fprintf(stderr, "WinWorkstation [info]: got ThreadRunningEvent\n");
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
 14613
#endif
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14614
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 14615
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14616
#if 0
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14617
    __rootDesk = OpenDesktop ("Desktop0", 0, FALSE, GENERIC_ALL);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14618
    if (!__rootDesk) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14619
	PRINTF(("OpenDesktop fail\n"));
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14620
	__rootDesk = CreateDesktop ("Desktop0", NULL, NULL, 0, DESKTOP_WRITEOBJECTS, NULL);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14621
	if (!__rootDesk) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14622
	    PRINTF(("CreateDesktop fail\n"));
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14623
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14624
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14625
#endif
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14626
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14627
    __rootWin = GetDesktopWindow();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14628
    __PROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14629
    id = __MKOBJ(__rootWin);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14630
    __UNPROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14631
    __INST(rootWin) = id; __STORE(self, id);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14632
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14633
    _rootDC = __rootDC = CreateDC("DISPLAY", NULL, NULL, NULL);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14634
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14635
    __tmpDC = CreateCompatibleDC(_rootDC);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14636
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 14637
    __nullPen = GetStockObject(NULL_PEN);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 14638
    __blackPen = GetStockObject(BLACK_PEN);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 14639
    __whitePen = GetStockObject(WHITE_PEN);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 14640
    __blackBrush = GetStockObject(BLACK_BRUSH);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 14641
    __whiteBrush = GetStockObject(WHITE_BRUSH);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 14642
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14643
    __PROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14644
    id = __MKOBJ(_rootDC);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14645
    __UNPROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14646
    __INST(rootDC) = id; __STORE(self, id);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14647
%}.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14648
!
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14649
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14650
initializeEventBuffer
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14651
    |sz|
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14652
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14653
%{
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14654
    sz = __MKSMALLINT(sizeof(struct queuedEvent) + 100);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14655
%}.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14656
    eventBuffer isNil ifTrue:[
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14657
	eventBuffer := ByteArray new:sz.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14658
    ].
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14659
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14660
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14661
initializeFor:aDisplayName
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14662
    "initialize the receiver for a connection to the display;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14663
     the argument, aDisplayName is ignored under Win32.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14664
     (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
 14665
      windows displays ...)"
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14666
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14667
    displayId notNil ifTrue:[
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 14668
	"/ already connected - trying to trick me ?
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 14669
	^ self
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14670
    ].
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14671
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14672
    displayId := self primInitializeFor:aDisplayName.
3632
a25578a48a6c Raise signal on device open error.
Stefan Vogel <sv@exept.de>
parents: 3589
diff changeset
 14673
    displayId isNil ifTrue:[
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 14674
	self class deviceOpenErrorSignal raiseWith:aDisplayName
3632
a25578a48a6c Raise signal on device open error.
Stefan Vogel <sv@exept.de>
parents: 3589
diff changeset
 14675
    ].
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14676
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14677
    dispatching := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14678
    isSlow := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14679
    shiftDown := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14680
    ctrlDown := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14681
    metaDown := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14682
    altDown := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14683
    motionEventCompression := true.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14684
    buttonsPressed := 0.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14685
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14686
    self initializeScreenProperties.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14687
    self initializeDevice.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14688
    self initializeVariableScreenProperties.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14689
    self initializeVariableSettingsProperties.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14690
    self initializeDeviceResourceTables.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14691
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14692
    self initializeDefaultValues.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14693
    self initializeEventBuffer.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14694
    self initializeSpecialFlags.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14695
    self initializeKeyboardMap.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14696
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14697
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14698
initializeModifierMappings
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14699
    shiftModifiers := #(#'Shift_L' #'Shift_R' #'Shift').
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14700
    ctrlModifiers := #(#'Ctrl_L' #'Ctrl_R' #'Ctrl').
4946
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
 14701
    metaModifiers := #(#'Alt_L' #'Alt' #'Menu').
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14702
    altModifiers := #(#'Alt_R').
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14703
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14704
2604
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
 14705
initializeSpecialFlags
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
 14706
    "perform additional special server implementation flags"
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
 14707
!
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
 14708
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14709
initializeVariableScreenProperties
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 14710
    "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
 14711
     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
 14712
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14713
%{
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 14714
    int nvi, i, val, capabilities, planes, numcolors, numpens;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14715
    RECT rect;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14716
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14717
    GetWindowRect(__rootWin, &rect);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14718
    __INST(width) = __MKSMALLINT(rect.right - rect.left);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14719
    __INST(height) = __MKSMALLINT(rect.bottom - rect.top);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14720
    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
 14721
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 14722
    __realDepth = GetDeviceCaps(__rootDC, BITSPIXEL);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14723
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14724
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14725
    __depth = 24;  /* its a hack */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14726
#else
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 14727
    __depth = __realDepth;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14728
    if (__depth == 15)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14729
	__depth = 16;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14730
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14731
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14732
#if 0
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14733
    numcolors = GetDeviceCaps(__rootDC, NUMCOLORS);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14734
    numpens = GetDeviceCaps(__rootDC, NUMPENS);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14735
    planes = GetDeviceCaps(__rootDC, PLANES);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14736
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14737
    DPRINTF(("screen has %d planes\n", planes));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14738
    DPRINTF(("numcolors is %d\n", numcolors));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14739
    DPRINTF(("numpens is %d\n", numpens));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14740
#endif
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14741
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14742
    __INST(depth) = __MKSMALLINT(__depth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14743
    __INST(ncells) = __MKSMALLINT(1<<__depth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14744
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14745
    val = GetDeviceCaps(__rootDC, HORZSIZE);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14746
    DPRINTF(("HORSIZE=%d\n",val));
4386
fb6f4030c861 care to not set widthMM/heightMM to 0
Claus Gittinger <cg@exept.de>
parents: 4374
diff changeset
 14747
    if (val > 0) {
fb6f4030c861 care to not set widthMM/heightMM to 0
Claus Gittinger <cg@exept.de>
parents: 4374
diff changeset
 14748
	__INST(widthMM) = __MKSMALLINT(val);
fb6f4030c861 care to not set widthMM/heightMM to 0
Claus Gittinger <cg@exept.de>
parents: 4374
diff changeset
 14749
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14750
    val = GetDeviceCaps(__rootDC, VERTSIZE);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14751
    DPRINTF(("VERTSIZE=%d\n",val));
4386
fb6f4030c861 care to not set widthMM/heightMM to 0
Claus Gittinger <cg@exept.de>
parents: 4374
diff changeset
 14752
    if (val > 0) {
fb6f4030c861 care to not set widthMM/heightMM to 0
Claus Gittinger <cg@exept.de>
parents: 4374
diff changeset
 14753
	__INST(heightMM) = __MKSMALLINT(val);
fb6f4030c861 care to not set widthMM/heightMM to 0
Claus Gittinger <cg@exept.de>
parents: 4374
diff changeset
 14754
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14755
    __logPixelSY = GetDeviceCaps(__rootDC, LOGPIXELSY);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14756
    capabilities = GetDeviceCaps(__rootDC, RASTERCAPS);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14757
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14758
#ifdef LATER
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14759
    console_printf("device support:\n");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14760
    if (capabilities & RC_BANDING)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14761
	console_printf(" RC_BANDING");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14762
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14763
    if (capabilities & RC_BITBLT)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14764
	console_printf(" RC_BITBLT");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14765
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14766
    if (capabilities & RC_BITMAP64)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14767
	console_printf(" RC_BITMAP64");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14768
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14769
    if (capabilities & RC_DI_BITMAP)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14770
	console_printf(" RC_DI_BITMAP");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14771
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14772
    if (capabilities & RC_DIBTODEV)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14773
	console_printf(" RC_DIBTODEV");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14774
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14775
    if (capabilities & RC_FLOODFILL)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14776
	console_printf(" RC_FLOODFILL");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14777
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14778
    if (capabilities & RC_PALETTE)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14779
	console_printf(" RC_PALETTE");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14780
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14781
    if (capabilities & RC_SCALING)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14782
	console_printf(" RC_SCALING");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14783
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14784
    if (capabilities & RC_STRETCHBLT)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14785
	console_printf(" RC_STRETCHBLT");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14786
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14787
    if (capabilities & RC_STRETCHDIB)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14788
	console_printf(" RC_STRETCHDIB");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14789
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14790
    console_printf("\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14791
    console_printf("cursor size %d %d\n", GetSystemMetrics(SM_CXCURSOR), GetSystemMetrics(SM_CYCURSOR));
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14792
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14793
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14794
    __INST(whitepixel) = __MKSMALLINT(WhitePixel);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14795
    __INST(blackpixel) = __MKSMALLINT(BlackPixel);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14796
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14797
    __INST(monitorType) = @symbol(unknown);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14798
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14799
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14800
    __INST(hasColors) = true;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14801
    __INST(hasGreyscales) = true;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14802
    __INST(visualType) = @symbol(TrueColor);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14803
    __INST(redShift) = __MKSMALLINT(0);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14804
    __INST(greenShift) = __MKSMALLINT(8);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14805
    __INST(blueShift) = __MKSMALLINT(16);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 14806
    switch (__realDepth) {
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14807
	case 15:
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14808
	case 16:
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14809
	    __INST(bitsPerRGB) = __MKSMALLINT(5);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14810
	    break;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14811
	default:
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14812
	    __INST(bitsPerRGB) = __MKSMALLINT(8);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14813
    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14814
    __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(8);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14815
    __INST(redMask) = __MKSMALLINT(0xFF);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14816
    __INST(greenMask) = __MKSMALLINT(0xFF00);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14817
    __INST(blueMask) = __MKSMALLINT(0xFF0000);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14818
#else
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14819
    if (! (capabilities & RC_PALETTE)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14820
	DPRINTF(("no palette\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14821
	if (__depth == 1) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14822
	    __INST(hasColors) = false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14823
	    __INST(hasGreyscales) = false;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14824
	    __INST(visualType) = @symbol(GrayScale);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14825
	    __INST(monitorType) = @symbol(monochrome);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14826
	} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14827
	    __INST(hasColors) = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14828
	    __INST(hasGreyscales) = true;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14829
	    if ((__depth == 16) || (__depth == 15)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14830
	      __INST(visualType) = @symbol(TrueColor);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14831
	      __INST(blueShift) = __MKSMALLINT(0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14832
	      __INST(greenShift) = __MKSMALLINT(5);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14833
	      __INST(redShift) = __MKSMALLINT(11);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14834
	      __INST(bitsPerRGB) = __MKSMALLINT(5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14835
	      __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14836
	      __INST(blueMask) = __MKSMALLINT(0x1f);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14837
	      __INST(greenMask) = __MKSMALLINT(0x7e0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14838
	      __INST(redMask) = __MKSMALLINT(0xf800);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14839
	    } else {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14840
	      __INST(visualType) = @symbol(TrueColor);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14841
	      __INST(redShift) = __MKSMALLINT(0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14842
	      __INST(greenShift) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14843
	      __INST(blueShift) = __MKSMALLINT(16);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14844
	      __INST(bitsPerRGB) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14845
	      __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14846
	      __INST(redMask) = __MKSMALLINT(0xFF);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14847
	      __INST(greenMask) = __MKSMALLINT(0xFF00);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14848
	      __INST(blueMask) = __MKSMALLINT(0xFF0000);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14849
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14850
	}
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14851
    } else {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14852
	val = GetDeviceCaps(__rootDC, SIZEPALETTE); /* First two entries are black and white. */
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14853
	// console_printf("SizeofPalette %d\n",val);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14854
	__INST(ncells) = __MKSMALLINT(val);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14855
	__INST(blackpixel) = __MKSMALLINT(0);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14856
	__INST(whitepixel) = __MKSMALLINT(1);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14857
	__INST(hasColors) = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14858
	__INST(hasGreyscales) = true;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14859
	// __INST(usingSystemPalette) = true;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14860
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14861
	__INST(redShift) = __MKSMALLINT(0);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14862
	__INST(greenShift) = __MKSMALLINT(2);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14863
	__INST(blueShift) = __MKSMALLINT(4);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14864
	__INST(bitsPerRGB) = __MKSMALLINT(2);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14865
	__INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(2);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14866
	__INST(redMask) = __MKSMALLINT(0x3);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14867
	__INST(greenMask) = __MKSMALLINT(0xc);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14868
	__INST(blueMask) = __MKSMALLINT(0x30);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14869
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14870
#endif /* ! ALWAYSTRUECOLOR */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14871
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14872
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14873
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14874
initializeVariableSettingsProperties
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14875
    "fetch properties which can be changed via the user settings.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14876
     Invoked initially and as a result of the settingsChange event."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14877
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14878
%{
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14879
    UINT multiClickTime;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14880
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14881
    multiClickTime = GetDoubleClickTime();
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14882
    DPRINTF(("multiClickTime = %d\n", multiClickTime));
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14883
    __INST(multiClickTimeDelta) = __MKSMALLINT(multiClickTime);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14884
%}
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14885
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 14886
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14887
primInitializeFor:aDisplayName
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14888
    "initialize the receiver for a connection to a display;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14889
     the argument, aDisplayName may be nil (for the default display)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14890
     or the name of the display server as hostname:number
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 14891
     (not yet under WIN32)"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14892
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14893
%{  /* NOCONTEXT */
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14894
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14895
    RETURN ( __MKSMALLINT(1) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14896
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14897
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14898
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14899
reinitialize
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14900
    rootWin := rootDC := nil.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14901
    super reinitialize.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14902
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14903
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14904
!WinWorkstation methodsFor:'keyboard mapping'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14905
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14906
altModifierMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14907
    "return the mask (in motionEvents) for the alt-key modifier.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14908
     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
 14909
     therefore return a variable here, which can be changed during startup."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14910
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14911
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14912
    RETURN (__MKSMALLINT(AltMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14913
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14914
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14915
    "Created: 23.3.1996 / 12:43:22 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14916
    "Modified: 23.3.1996 / 12:44:56 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14917
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14918
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14919
leftAltMask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14920
    "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
 14921
     See comment in altModifierMask: / metaModifierMask: for what
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14922
     this could be used."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14923
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14924
%{  /* NOCONTEXT */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14925
    RETURN (__MKSMALLINT(LeftAltMask));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14926
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14927
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14928
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14929
metaModifierMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14930
    "return the mask (in motionEvents) for the meta-key modifier.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14931
     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
 14932
     therefore return a variable here, which can be changed during startup."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14933
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14934
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14935
    RETURN (__MKSMALLINT(MetaMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14936
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14937
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14938
    "Created: 23.3.1996 / 12:43:39 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14939
    "Modified: 23.3.1996 / 12:45:09 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14940
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14941
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14942
modifierMapping
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14943
    "Get the Modifier Mapping.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14944
     We return an array of arrays of keycodes"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14945
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14946
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14947
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14948
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14949
rightAltMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14950
    "return the mask bit for the right Alt modifier key.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14951
     See comment in altModifierMask: / metaModifierMask: for what
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14952
     this could be used."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14953
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14954
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14955
    RETURN (__MKSMALLINT(RightAltMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14956
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14957
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14958
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14959
stringFromKeycode:code
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14960
    "Get a KeySymbol (a smalltalk symbol) from the keycode."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14961
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14962
    ^ ''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14963
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14964
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14965
	Display stringFromKeycode:28
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
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
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14969
!WinWorkstation methodsFor:'misc'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14970
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14971
beep
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14972
    "output an audible beep"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14973
5248
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 14974
    self beep:#iconExclamation volume:100.
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14975
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14976
    "
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14977
      Display beep
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14978
    "
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14979
!
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14980
5248
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 14981
beep:aSymbolOrInteger volume:volumeInPercent
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 14982
    "output an audible beep, aSymbolOrInteger define, which sound is used.
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 14983
     Volume is ignored here (kept for compatibility with XWorkstation"
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14984
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14985
    UserPreferences current beepEnabled ifFalse:[^ self].
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14986
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14987
%{
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14988
    unsigned int type;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14989
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14990
    if (__isSmallInteger(aSymbolOrInteger)) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14991
	type = __smallIntegerVal(aSymbolOrInteger);
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14992
    } else if (aSymbolOrInteger == @symbol(iconAsterisk)) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14993
	type = MB_ICONASTERISK;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14994
    } else if (aSymbolOrInteger == @symbol(iconExclamation)) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14995
	type = MB_ICONEXCLAMATION;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14996
    } else if (aSymbolOrInteger == @symbol(iconHand)) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14997
	type = MB_ICONHAND;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 14998
    } else if (aSymbolOrInteger == @symbol(iconQuestion)) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14999
	type = MB_ICONQUESTION;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15000
    } else if (aSymbolOrInteger == @symbol(ok)) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15001
	type = MB_OK;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15002
    } else {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15003
	type = 0xffffffff;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15004
    }
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15005
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 15006
#ifdef BEEP_IN_WINTHREAD
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 15007
    PostThreadMessage(_dispatchThreadId, WM_THREAD_BEEP, 0, 0);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 15008
#else
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15009
    MessageBeep(type);
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15010
#endif
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15011
%}
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15012
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15013
    "
5248
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15014
      Display beep:#iconExclamation volume:100
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15015
      Display beep:#iconAsterisk volume:100
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15016
      Display beep:#iconQuestion volume:100
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15017
      Display beep:#iconHand volume:100
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15018
      Display beep:#ok volume:100
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15019
      Display beep:nil volume:100
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15020
      Display beep:0 volume:100
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15021
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15022
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15023
4832
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15024
canEndSession:aBoolean
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15025
    "if set to false, Windows is not allowed to finish this session.
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15026
     The default is true."
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15027
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15028
    CanEndSession := aBoolean.
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15029
!
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15030
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15031
flush
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15032
    "send all buffered drawing to the display.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15033
     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
 15034
     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
 15035
     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
 15036
     (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
 15037
     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
 15038
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15039
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15040
     GdiFlush();
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15041
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15042
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15043
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15044
monitorHandleForPoint:aPoint
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15045
    "given a point, return a handle to the monitor"
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15046
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15047
    |pX pY|
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15048
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15049
    pX := aPoint x.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15050
    pY := aPoint y.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15051
%{
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15052
    if (__bothSmallInteger(pX, pY)) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15053
	POINT p;
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15054
	HMONITOR hMonitor;
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15055
	p.x = pX;
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15056
	p.y = pY;
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15057
#if 0
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15058
	static HMONITOR (__stdcall *P_MonitorFromPoint)(POINT, int);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15059
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15060
	if (P_MonitorFromPoint == 0) {
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15061
	    HINSTANCE hUser = LoadLibrary("user32.dll");
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15062
	    // console_printf("hUser: %x\n", hUser);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15063
	    if (hUser) {
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15064
		P_MonitorFromPoint = (HMONITOR (__stdcall *)(POINT, int ))
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15065
				    GetProcAddress(hUser, "MonitorFromPoint");
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15066
	    }
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15067
	}
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15068
	// console_printf("P_MonitorFromPoint: %x\n", P_MonitorFromPoint);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15069
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15070
	hMonitor = (*P_MonitorFromPoint)(p, MONITOR_DEFAULTTONULL);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15071
#else
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15072
	hMonitor = MonitorFromPoint(p, MONITOR_DEFAULTTONULL);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15073
#endif
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15074
	if (hMonitor == 0) {
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15075
	    RETURN(nil);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15076
	}
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15077
	RETURN ( __MKEXTERNALADDRESS(hMonitor) );
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15078
    }
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15079
%}
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15080
    "
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15081
     Screen current monitorHandleForPoint:(0@0)
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15082
     Screen current monitorHandleForPoint:(1500@0)
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15083
     Screen current monitorHandleForPoint:(3000@0)
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15084
    "
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15085
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15086
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15087
monitorHandleForView:aWindowId
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15088
    "given a window ID, return a handle to the monitor"
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15089
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15090
%{
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15091
    if (__isExternalAddress(aWindowId)) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15092
	HWND hWnd = _HWNDVal(aWindowId);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15093
	HMONITOR hMonitor;
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15094
#if 0
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15095
	static HMONITOR (__stdcall *P_MonitorFromWindow)(HWND, int);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15096
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15097
	if (P_MonitorFromWindow == 0) {
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15098
	    HINSTANCE hUser = LoadLibrary("user32.dll");
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15099
	    // console_printf("hUser: %x\n", hUser);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15100
	    if (hUser) {
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15101
		P_MonitorFromWindow = (HMONITOR (__stdcall *)(HWND, int ))
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15102
				    GetProcAddress(hUser, "MonitorFromWindow");
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15103
	    }
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15104
	}
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15105
	// console_printf("P_MonitorFromWindow: %x\n", P_MonitorFromWindow);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15106
	hMonitor = (*P_MonitorFromWindow)(hWnd, MONITOR_DEFAULTTONULL);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15107
#else
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15108
	hMonitor = MonitorFromWindow(hWnd, MONITOR_DEFAULTTONULL);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15109
#endif
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15110
	if (hMonitor == 0) {
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15111
	    RETURN(nil);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15112
	}
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15113
	RETURN ( __MKEXTERNALADDRESS(hMonitor) );
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15114
    }
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15115
%}
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15116
    "
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15117
     Screen current monitorHandleForView:(Transcript topView id)
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15118
     Screen current monitorHandleForPoint:(0@0)
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15119
    "
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15120
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15121
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15122
setInputFocusTo:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15123
    self setInputFocusTo:aWindowId revertTo:nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15124
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15125
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15126
setInputFocusTo:aWindowId revertTo:revertSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15127
    "set the focus to the view as defined by aWindowId.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15128
     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
 15129
     input until a new focus is set.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15130
     RevertSymbol specifies what should happen if the view becomes invisible;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15131
     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
 15132
     given to the parent view, the root view or no view."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15133
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15134
%{
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15135
    if (__isExternalAddress(aWindowId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15136
	HWND hWnd = _HWNDVal(aWindowId);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 15137
	int r = 0;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15138
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15139
	if (revertSymbol == @symbol(parent)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15140
	    r = 1;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15141
	} else if (revertSymbol == @symbol(root)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15142
	    r = 2;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15143
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15144
	if (hWnd) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15145
	    if (GetFocus() != hWnd) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15146
		CPRINTF(("setInputFocusTo %x revertTo %d\n",hWnd,r));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15147
#ifdef SET_FOCUS_IN_WINTHREAD
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 15148
		PostMessage(hWnd, WM_THREAD_SETFOCUS, (INT)hWnd, GetCurrentThreadId());
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15149
#else
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15150
		if (SetFocus(hWnd) == 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15151
		    PRINTF(("SetFocus to %x failed.\n",hWnd));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15152
		}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15153
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15154
	    } else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15155
		CPRINTF(("setInputFocusTo %x revertTo %d\n",hWnd,r));
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 15156
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15157
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15158
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15159
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15160
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15161
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15162
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15163
!WinWorkstation methodsFor:'native dialogs'!
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15164
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15165
nativeConfirm:aString title:titleString flags:flags initialAnswer:trueOrFalse
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15166
     ^ self
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15167
	    nativeMessageBoxFor:nil
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15168
	    text:aString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15169
	    title:titleString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15170
	    flags:flags
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15171
	    blocking:false
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15172
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15173
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15174
      Screen current
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15175
	nativeConfirm:'please confirm'
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15176
	title:'Confirm'
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15177
	flags:#( APPLMODAL ICONQUESTION OKCANCEL)
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15178
	initialAnswer:true
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15179
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15180
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15181
      Screen current
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15182
	nativeConfirm:'Yes or No'
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15183
	title:'Confirm'
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15184
	flags:#( APPLMODAL ICONQUESTION YESNO)
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15185
	initialAnswer:true
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15186
     "
4732
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15187
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15188
    "Modified: / 02-03-2007 / 15:37:57 / cg"
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15189
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15190
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15191
nativeConfirmOKCancel:aString title:titleString initialAnswer:trueOrFalse
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15192
     ^ (self
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15193
	    nativeConfirm:aString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15194
	    title:titleString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15195
	    flags:#( APPLMODAL ICONQUESTION OKCANCEL)
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15196
	    initialAnswer:trueOrFalse) == #IDOK
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15197
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15198
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15199
      Screen current
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15200
	nativeConfirmOKCancel:'please confirm' title:'Confirm' initialAnswer:true
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15201
     "
4732
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15202
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15203
    "Modified: / 02-03-2007 / 15:37:32 / cg"
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15204
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15205
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15206
nativeConfirmYesNo:aString title:titleString initialAnswer:trueOrFalse
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15207
     ^ (self
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15208
	    nativeConfirm:aString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15209
	    title:titleString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15210
	    flags:#( APPLMODAL ICONQUESTION YESNO)
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15211
	    initialAnswer:trueOrFalse) == #IDYES
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15212
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15213
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15214
      Screen current
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15215
	nativeConfirmYesNo:'please confirm' title:'Confirm' initialAnswer:true
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15216
     "
4732
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15217
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15218
    "Modified: / 02-03-2007 / 15:12:49 / cg"
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15219
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15220
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15221
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
 15222
	     initialAnswer:initialOrNil
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15223
	     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
 15224
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15225
    "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
 15226
     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
 15227
     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
 15228
     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
 15229
     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
 15230
     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
 15231
		       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
 15232
		       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
 15233
		       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
 15234
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15235
     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
 15236
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15237
    |flags|
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15238
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15239
    isSaveDialog ifTrue:[
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15240
	flags := #(
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15241
			#ENABLESIZING
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15242
			#HIDEREADONLY
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15243
			#EXPLORER
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15244
			#ENABLESIZING
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15245
			#OVERWRITEPROMPT
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15246
		  )
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15247
    ] ifFalse:[
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15248
	flags := #(
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15249
			#ENABLESIZING
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15250
			#HIDEREADONLY
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15251
			#EXPLORER
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15252
			#ENABLESIZING
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15253
		  )
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15254
    ].
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15255
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15256
    ^ self
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15257
	nativeFileDialogFor:ownerId
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15258
	save:isSaveDialog
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15259
	title:titleOrNil
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15260
	inDirectory:dirPathOrNil
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15261
	initialAnswer:initialOrNil
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15262
	flags:flags
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15263
	filter:filterArrayOrNil
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15264
	extension:extensionOrNil
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15265
	blocking:false
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15266
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15267
    "
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15268
     Display
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15269
	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
 15270
	title:'Test OpenFile Dialog'
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15271
	inDirectory:nil
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15272
	initialAnswer:nil
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15273
	filter:nil
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15274
	extension:nil
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15275
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15276
     Display
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15277
	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
 15278
	title:'Test SaveFile Dialog'
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15279
	inDirectory:nil
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15280
	initialAnswer:nil
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15281
	filter:nil
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15282
	extension:nil
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15283
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15284
     Display
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15285
	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
 15286
	title:'Test SaveFile Dialog'
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15287
	inDirectory:nil
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15288
	initialAnswer:'newFile.bmp'
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15289
	filter:nil
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15290
	extension:'bmp'
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15291
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15292
     Display
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15293
	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
 15294
	title:'Test OpenFile Dialog'
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15295
	inDirectory:nil
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15296
	initialAnswer:nil
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15297
	filter:#(
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15298
		    #( 'all files'       '*.*' )
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15299
		    #( 'smalltalk files' '*.st' )
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15300
		    #( 'change files'    '*.chg' )
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15301
		    #( 'image files'     '*.img' )
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15302
		)
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15303
	extension:nil
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15304
    "
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15305
!
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15306
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15307
nativeFileDialogFor:ownerId save:isSaveDialog title:titleOrNil inDirectory:dirPathOrNil
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15308
	     initialAnswer:initialOrNil flags:flagArray
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15309
	     filter:filterArrayOrNil extension:extensionOrNil
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15310
	     blocking:blocking
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15311
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15312
    "start a native open-file dialog.
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15313
     If not cancelled, the selected fileName is returned; nil otherwise.
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15314
     Of course, this one looks like the
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15315
     Windows file dialog - no matter which viewStyle settings are active.
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15316
     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
 15317
     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
 15318
		       each element specifying filter commnet and filter
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15319
		       i.e. #( 'bitmap files (*.bmp)' '*.bmp' )
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15320
		       i.e. #( 'smalltalk files' '*.st' )
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15321
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15322
     EXPERIMENTAL & non-portable: use with caution"
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15323
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15324
    |rslt errorCode fileName|
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15325
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15326
%{  /* STACK: 32000*/
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15327
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15328
#ifndef NO_NATIVE_DIALOGS
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15329
    OPENFILENAME ofn;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15330
    HWND hWndOwner = NULL;
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15331
    char fileNameBuffer[256] = "\0";
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15332
    char filterBuffer[1024*4] = "\0";
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15333
    BOOL __rslt;
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15334
    jmp_buf exitJmpBuf;
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15335
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15336
    if (__isExternalAddress(ownerId)) {
3521
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 15337
	hWndOwner = _HWNDVal(ownerId);
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 15338
    }
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 15339
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15340
# ifdef OPENFILENAME_SIZE_VERSION_400
3526
e9c3f08c2305 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3525
diff changeset
 15341
    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
 15342
# else
3544
6c59714157cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3526
diff changeset
 15343
    ofn.lStructSize = sizeof(ofn);
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15344
# endif
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15345
    ofn.hwndOwner = hWndOwner;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15346
    ofn.hInstance = NULL;
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15347
4405
f4c62bb63035 isArrayLike to support immutable arrays
Claus Gittinger <cg@exept.de>
parents: 4388
diff changeset
 15348
    if ((filterArrayOrNil != nil) && __isArrayLike(filterArrayOrNil)) {
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15349
	char *dst = filterBuffer;
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 15350
	unsigned int idx;
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15351
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15352
	for (idx=0; idx<__arraySize(filterArrayOrNil); idx++) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15353
	    OBJ el = __ArrayInstPtr(filterArrayOrNil)->a_element[idx];
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15354
// console_printf("idx = %d\n", idx);
4405
f4c62bb63035 isArrayLike to support immutable arrays
Claus Gittinger <cg@exept.de>
parents: 4388
diff changeset
 15355
	    if (__isArrayLike(el) && (__arraySize(el) == 2)) {
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15356
		OBJ descr, filter;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15357
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15358
		descr = __ArrayInstPtr(el)->a_element[0];
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15359
		filter = __ArrayInstPtr(el)->a_element[1];
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 15360
		if (__isStringLike(descr) && __isStringLike(filter)) {
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15361
		    char *src = __stringVal(descr);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15362
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15363
// console_printf("descr: %s filter: %s\n", __stringVal(descr), __stringVal(filter));
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15364
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15365
		    // append (incl 0-byte)
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15366
		    while (*src) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15367
			*dst++ = *src++;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15368
		    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15369
		    *dst++ = '\0';
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15370
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15371
		    src = __stringVal(filter);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15372
		    // append (incl 0-byte)
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15373
		    while (*src) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15374
			*dst++ = *src++;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15375
		    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15376
		    *dst++ = '\0';
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15377
		}
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15378
	    }
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15379
	}
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15380
	*dst++ = '\0';
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15381
	*dst = '\0';
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15382
	ofn.lpstrFilter = filterBuffer;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15383
	ofn.nFilterIndex = 1;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15384
    } else {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15385
	ofn.lpstrFilter = NULL;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15386
	ofn.nFilterIndex = 0;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15387
    }
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15388
    ofn.lpstrCustomFilter = NULL;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15389
    ofn.nMaxCustFilter = 0;
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15390
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 15391
    if (__isStringLike(initialOrNil)) {
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15392
	strcpy(fileNameBuffer, __stringVal(initialOrNil));
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15393
    }
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15394
    ofn.lpstrFile = fileNameBuffer;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15395
    ofn.nMaxFile = sizeof(fileNameBuffer);
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15396
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15397
    ofn.lpstrFileTitle = NULL;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15398
    ofn.nMaxFileTitle = 0;
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 15399
    if (__isStringLike(dirPathOrNil)) {
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15400
	ofn.lpstrInitialDir = __stringVal(dirPathOrNil);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15401
    } else {
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15402
	ofn.lpstrInitialDir = NULL;
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15403
    }
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15404
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 15405
    if (__isStringLike(titleOrNil)) {
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15406
	ofn.lpstrTitle = __stringVal(titleOrNil);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15407
    } else {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15408
	ofn.lpstrTitle = "";
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15409
    }
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15410
    ofn.nFileOffset = 0;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15411
    ofn.nFileExtension = 0;
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 15412
    if (__isStringLike(extensionOrNil)) {
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15413
	ofn.lpstrDefExt = __stringVal(extensionOrNil);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15414
    } else {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15415
	ofn.lpstrDefExt = NULL;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15416
    }
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15417
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15418
    ofn.lCustData = NULL;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15419
    ofn.lpfnHook = NULL;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15420
    ofn.lpTemplateName = NULL;
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15421
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15422
    ofn.Flags = 0;
4405
f4c62bb63035 isArrayLike to support immutable arrays
Claus Gittinger <cg@exept.de>
parents: 4388
diff changeset
 15423
    if (__isNonNilObject(flagArray) && __isArrayLike(flagArray)) {
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 15424
	unsigned int i;
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15425
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15426
	for (i=0; i<__arraySize(flagArray); i++) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15427
	    OBJ flag = __ArrayInstPtr(flagArray)->a_element[i];
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15428
	    int flagVal = 0;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15429
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15430
	    if (__isSmallInteger(flag)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15431
		flagVal = __intVal(flag);
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15432
	    } else if (flag == @symbol(READONLY)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15433
		flagVal = OFN_READONLY;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15434
	    } else if (flag == @symbol(OVERWRITEPROMPT)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15435
		flagVal = OFN_OVERWRITEPROMPT;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15436
	    } else if (flag == @symbol(HIDEREADONLY)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15437
		flagVal = OFN_HIDEREADONLY;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15438
	    } else if (flag == @symbol(NOCHANGEDIR)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15439
		flagVal = OFN_NOCHANGEDIR;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15440
	    } else if (flag == @symbol(SHOWHELP)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15441
		flagVal = OFN_SHOWHELP;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15442
	    } else if (flag == @symbol(ENABLEHOOK)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15443
		flagVal = OFN_ENABLEHOOK;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15444
	    } else if (flag == @symbol(ENABLETEMPLATE)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15445
		flagVal = OFN_ENABLETEMPLATE;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15446
	    } else if (flag == @symbol(ENABLETEMPLATEHANDLE)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15447
		flagVal = OFN_ENABLETEMPLATEHANDLE;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15448
	    } else if (flag == @symbol(NOVALIDATE)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15449
		flagVal = OFN_NOVALIDATE;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15450
	    } else if (flag == @symbol(ALLOWMULTISELECT)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15451
		flagVal = OFN_ALLOWMULTISELECT;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15452
	    } else if (flag == @symbol(EXTENSIONDIFFERENT)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15453
		flagVal = OFN_EXTENSIONDIFFERENT;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15454
	    } else if (flag == @symbol(PATHMUSTEXIST)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15455
		flagVal = OFN_PATHMUSTEXIST;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15456
	    } else if (flag == @symbol(FILEMUSTEXIST)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15457
		flagVal = OFN_FILEMUSTEXIST;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15458
	    } else if (flag == @symbol(CREATEPROMPT)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15459
		flagVal = OFN_CREATEPROMPT;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15460
	    } else if (flag == @symbol(SHAREAWARE)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15461
		flagVal = OFN_SHAREAWARE;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15462
	    } else if (flag == @symbol(NOREADONLYRETURN)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15463
		flagVal = OFN_NOREADONLYRETURN;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15464
	    } else if (flag == @symbol(NOTESTFILECREATE)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15465
		flagVal = OFN_NOTESTFILECREATE;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15466
	    } else if (flag == @symbol(NONETWORKBUTTON)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15467
		flagVal = OFN_NONETWORKBUTTON;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15468
	    } else if (flag == @symbol(NOLONGNAMES)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15469
		flagVal = OFN_NOLONGNAMES;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15470
# ifdef OFN_EXPLORER
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15471
	    } else if (flag == @symbol(EXPLORER)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15472
		flagVal = OFN_EXPLORER;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15473
# endif
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15474
# ifdef OFN_NODEREFERENCELINKS
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15475
	    } else if (flag == @symbol(NODEREFERENCELINKS)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15476
		flagVal = OFN_NODEREFERENCELINKS;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15477
# endif
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15478
# ifdef OFN_LONGNAMES
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15479
	    } else if (flag == @symbol(LONGNAMES)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15480
		flagVal = OFN_LONGNAMES;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15481
# endif
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15482
# ifdef OFN_ENABLEINCLUDENOTIFY
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15483
	    } else if (flag == @symbol(ENABLEINCLUDENOTIFY)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15484
		flagVal = OFN_ENABLEINCLUDENOTIFY;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15485
# endif
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15486
# ifdef OFN_ENABLESIZING
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15487
	    } else if (flag == @symbol(ENABLESIZING)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15488
		flagVal = OFN_ENABLESIZING;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15489
# endif
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15490
	    }
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15491
	    ofn.Flags |= flagVal;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15492
	}
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15493
    }
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15494
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15495
    if (isSaveDialog == true) {
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15496
	if (blocking == true) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15497
	    __rslt = GetSaveFileName(&ofn);
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15498
	} else {
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15499
	    do {
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15500
		__threadErrno = 0;
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15501
		__rslt = __STX_API_CALL1( "GetSaveFileName", (void *)GetSaveFileName, (void *)(&ofn));
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15502
	    } while ((__rslt < 0) && (__threadErrno == EINTR));
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15503
	}
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15504
    } else {
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15505
	if (blocking == true) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15506
	    __rslt = GetOpenFileName(&ofn);
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15507
	} else {
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15508
	    do {
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15509
		__threadErrno = 0;
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15510
		__rslt = __STX_API_CALL1( "GetOpenFileName", (void *)GetOpenFileName, (void *)(&ofn));
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15511
	    } while ((__rslt < 0) && (__threadErrno == EINTR));
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15512
	}
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15513
    }
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15514
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15515
    if ( @global(WinWorkstation:VerboseNativeDialogs) == true) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15516
	console_fprintf(stderr, "WinWorkstation [info]: after GetOpenFileName\n");
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15517
    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15518
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15519
    if (setjmp(exitJmpBuf)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15520
	__setAtExitLongJmp(0);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15521
	if ( @global(WinWorkstation:VerboseNativeDialogs) == true) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15522
	    console_fprintf(stderr, "WinWorkstation [warning]: exit longjmp\n");
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15523
	}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15524
	rslt = false;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15525
	errorCode = __MKSMALLINT(0);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15526
	goto getOutOfHere;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15527
    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15528
    __setAtExitLongJmp(exitJmpBuf);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15529
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15530
    if (__rslt == TRUE) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15531
	rslt = true;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15532
	fileName = __MKSTRING(fileNameBuffer);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15533
    } else {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15534
	rslt = false;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15535
	errorCode = __MKSMALLINT(CommDlgExtendedError());
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15536
    }
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15537
    __setAtExitLongJmp(0);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15538
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15539
#else
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15540
    errorCode = __MKSMALLINT(-1);
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15541
#endif /* NO_NATIVE_DIALOGS */
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15542
getOutOfHere: ;
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15543
%}.
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15544
    (errorCode notNil) ifTrue:[
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 15545
	errorCode ~~ 0 ifTrue:[
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 15546
	    self primitiveFailed.
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 15547
	].
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 15548
	^ nil
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15549
    ].
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15550
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15551
    ^ fileName
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15552
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15553
    "
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15554
     Display
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15555
	nativeFileDialogFor:nil save:false
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15556
	title:'Test OpenFile Dialog'
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15557
	inDirectory:nil
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15558
	initialAnswer:nil
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15559
	flags:#( ENABLESIZING HIDEREADONLY EXPLORER ENABLESIZING )
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15560
	filter:#(
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15561
		    #( 'all files'       '*.*' )
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15562
		    #( 'smalltalk files' '*.st' )
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15563
		    #( 'change files'    '*.chg' )
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15564
		    #( 'image files'     '*.img' )
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15565
		)
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15566
	extension:nil
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15567
	blocking:false
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15568
    "
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15569
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15570
    "
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15571
     Display
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15572
	nativeFileDialogFor:nil save:false
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15573
	title:'Test OpenFile Dialog'
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15574
	inDirectory:nil
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15575
	initialAnswer:nil
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15576
	flags:#( ENABLESIZING HIDEREADONLY EXPLORER ENABLESIZING )
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15577
	filter:#(
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15578
		    #( 'all files'       '*.*' )
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15579
		    #( 'smalltalk files' '*.st' )
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15580
		    #( 'change files'    '*.chg' )
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15581
		    #( 'image files'     '*.img' )
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15582
		)
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15583
	extension:nil
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15584
	blocking:true
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15585
    "
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15586
!
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15587
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15588
nativeGetDefaultPrinterDialog
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15589
    "start a native printer dialog.
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15590
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15591
     EXPERIMENTAL & non-portable: use with caution"
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15592
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15593
    |errorCode newDCHandle|
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15594
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15595
%{  /* STACK: 32000*/
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15596
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15597
#ifdef NO_NATIVE_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15598
# define NO_NATIVE_PRINT_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15599
#endif
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15600
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15601
#define NO_NATIVE_PRINT_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15602
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15603
#ifndef NO_NATIVE_PRINT_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15604
    PRINTDLG pdsetup;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15605
    OBJ newGCHandle;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15606
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15607
    memset(&pdsetup, 0, sizeof(pdsetup));
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15608
    pdsetup.lStructSize = sizeof(pdsetup);
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15609
    pdsetup.Flags = PD_RETURNDEFAULT | PD_RETURNDC;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15610
    if (! PrintDlg(&pdsetup)) {
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 15611
	RETURN (nil);
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15612
    }
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15613
    if ( pdsetup.hDC ) {
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 15614
	newDCHandle = __MKOBJ( pdsetup.hDC );
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15615
    }
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15616
#else
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15617
    errorCode = __MKSMALLINT(-1);
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15618
#endif /* NO_NATIVE_PRINT_DIALOGS */
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15619
%}.
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15620
    (errorCode notNil) ifTrue:[
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 15621
	self primitiveFailed.
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 15622
	^ nil
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15623
    ].
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15624
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15625
    ^ newDCHandle
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15626
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15627
    "
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15628
     Display nativeGetDefaultPrinterDialog
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15629
    "
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15630
!
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15631
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15632
nativeGetPrinterDialogDefault:defaultBoolean
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15633
    "start a native printer dialog.
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15634
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15635
     EXPERIMENTAL & non-portable: use with caution"
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15636
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15637
    |errorCode newDCHandle|
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15638
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15639
%{  /* STACK: 32000*/
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15640
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15641
#ifdef NO_NATIVE_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15642
# define NO_NATIVE_PRINT_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15643
#endif
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15644
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15645
#define xxNO_NATIVE_PRINT_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15646
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15647
#ifndef NO_NATIVE_PRINT_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15648
    PRINTDLG pdsetup;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15649
    OBJ newGCHandle;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15650
    int answer;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15651
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15652
    memset(&pdsetup, 0, sizeof(pdsetup));
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15653
    pdsetup.lStructSize = sizeof(pdsetup);
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15654
    pdsetup.Flags = PD_RETURNDC;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15655
    if (defaultBoolean == true) {
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 15656
	pdsetup.Flags |= PD_RETURNDEFAULT;
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15657
    }
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15658
# ifdef BLOCKING
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15659
    answer = PrintDlg(&pdsetup);
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15660
# else
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15661
    answer = __STX_API_CALL1( "PrintDlg",
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 15662
					(void *)PrintDlg,
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 15663
					(void *)&pdsetup );
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15664
# endif
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15665
    if (! answer) {
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 15666
	RETURN (nil);
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15667
    }
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15668
    if ( pdsetup.hDC ) {
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 15669
	newDCHandle = __MKOBJ( pdsetup.hDC );
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15670
    }
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15671
#else
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15672
    errorCode = __MKSMALLINT(-1);
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15673
#endif /* NO_NATIVE_PRINT_DIALOGS */
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15674
%}.
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15675
    (errorCode notNil) ifTrue:[
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 15676
	self primitiveFailed.
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 15677
	^ nil
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15678
    ].
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15679
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15680
    ^ newDCHandle
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15681
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15682
    "
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15683
     Display nativeGetPrinterDialogDefault:true
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15684
     Display nativeGetPrinterDialogDefault:false
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15685
    "
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15686
!
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 15687
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15688
nativeInformationOK:aString title:titleString
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15689
     ^ self
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15690
	    nativeConfirm:aString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15691
	    title:titleString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15692
	    flags:#( APPLMODAL ICONINFORMATION OK)
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15693
	    initialAnswer:nil
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15694
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15695
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15696
      Screen current
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15697
	nativeInformationOK:'Some Info' title:'Info'
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15698
     "
4732
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15699
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15700
    "Modified: / 02-03-2007 / 15:37:40 / cg"
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15701
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15702
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15703
nativeMessageBoxFor:ownerId text:textOrNil title:titleOrNil flags:flagArray blocking:blocking
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15704
    "start a native message box dialog.
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15705
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15706
     EXPERIMENTAL & non-portable: use with caution"
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15707
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15708
    |errorCode answer|
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15709
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15710
%{  /* STACK: 32000*/
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15711
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15712
#ifndef NO_NATIVE_DIALOGS
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15713
    HWND hWndOwner = NULL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15714
    int boxFlags = 0;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15715
    char *__title;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15716
    char *__text;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15717
    int __answer;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15718
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15719
    if (__isExternalAddress(ownerId)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15720
	hWndOwner = _HWNDVal(ownerId);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15721
    }
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 15722
    if (__isStringLike(titleOrNil)) {
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15723
	__title = __stringVal(titleOrNil);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15724
    } else {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15725
	__title = "";
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15726
    }
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 15727
    if (__isStringLike(textOrNil)) {
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15728
	__text = __stringVal(textOrNil);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15729
    } else {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15730
	__text = "";
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15731
    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15732
4405
f4c62bb63035 isArrayLike to support immutable arrays
Claus Gittinger <cg@exept.de>
parents: 4388
diff changeset
 15733
    if (__isNonNilObject(flagArray) && __isArrayLike(flagArray)) {
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 15734
	unsigned int i;
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15735
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15736
	for (i=0; i<__arraySize(flagArray); i++) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15737
	    OBJ flag = __ArrayInstPtr(flagArray)->a_element[i];
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15738
	    int flagVal = 0;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15739
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15740
	    if (__isSmallInteger(flag)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15741
		flagVal = __intVal(flag);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15742
	    } else if (flag == @symbol(ABORTRETRYIGNORE)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15743
		flagVal = MB_ABORTRETRYIGNORE;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15744
	    } else if (flag == @symbol(APPLMODAL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15745
		flagVal = MB_APPLMODAL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15746
	    } else if (flag == @symbol(DEFAULT_DESKTOP_ONLY)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15747
		flagVal = MB_DEFAULT_DESKTOP_ONLY;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15748
	    } else if (flag == @symbol(DEFBUTTON1)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15749
		flagVal = MB_DEFBUTTON1;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15750
	    } else if (flag == @symbol(DEFBUTTON2)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15751
		flagVal = MB_DEFBUTTON2;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15752
	    } else if (flag == @symbol(DEFBUTTON3)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15753
		flagVal = MB_DEFBUTTON3;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15754
	    } else if (flag == @symbol(ICONASTERISK)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15755
		flagVal = MB_ICONASTERISK;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15756
	    } else if (flag == @symbol(ICONHAND)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15757
		flagVal = MB_ICONHAND;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15758
	    } else if (flag == @symbol(ICONINFORMATION)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15759
		flagVal = MB_ICONINFORMATION;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15760
	    } else if (flag == @symbol(ICONQUESTION)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15761
		flagVal = MB_ICONQUESTION;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15762
	    } else if (flag == @symbol(ICONSTOP)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15763
		flagVal = MB_ICONSTOP;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15764
	    } else if (flag == @symbol(OK)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15765
		flagVal = MB_OK;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15766
	    } else if (flag == @symbol(OKCANCEL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15767
		flagVal = MB_OKCANCEL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15768
	    } else if (flag == @symbol(RETRYCANCEL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15769
		flagVal = MB_RETRYCANCEL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15770
	    } else if (flag == @symbol(SETFOREGROUND)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15771
		flagVal = MB_SETFOREGROUND;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15772
	    } else if (flag == @symbol(SYSTEMMODAL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15773
		flagVal = MB_SYSTEMMODAL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15774
	    } else if (flag == @symbol(TASKMODAL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15775
		flagVal = MB_TASKMODAL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15776
	    } else if (flag == @symbol(YESNO)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15777
		flagVal = MB_YESNO;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15778
	    } else if (flag == @symbol(YESNOCANCEL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15779
		flagVal = MB_YESNOCANCEL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15780
	    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15781
	    boxFlags |= flagVal;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15782
	}
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15783
    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15784
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15785
    if (blocking == true) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15786
	__answer = MessageBox(hWndOwner,
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15787
		   __text,
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15788
		   __title,
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15789
		   boxFlags);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15790
    } else {
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15791
	do {
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15792
	    __threadErrno = 0;
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15793
	    __answer = __STX_API_CALL4( "MessageBox",
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15794
					(void *)MessageBox,
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15795
					(void *)hWndOwner,
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15796
					(void *)__text,
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15797
					(void *)__title,
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15798
					(void *)boxFlags);
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 15799
	} while ((__answer < 0) && (__threadErrno == EINTR));
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15800
    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15801
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15802
    switch (__answer) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15803
	case IDABORT:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15804
	    answer = @symbol(IDABORT);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15805
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15806
	case IDCANCEL:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15807
	    answer = @symbol(IDCANCEL);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15808
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15809
	case IDIGNORE:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15810
	    answer = @symbol(IDIGNORE);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15811
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15812
	case IDNO:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15813
	    answer = @symbol(IDNO);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15814
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15815
	case IDOK:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15816
	    answer = @symbol(IDOK);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15817
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15818
	case IDRETRY:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15819
	    answer = @symbol(IDRETRY);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15820
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15821
	case IDYES:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15822
	    answer = @symbol(IDYES);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15823
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15824
	default:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15825
	    answer = __MKSMALLINT(__answer);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15826
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15827
    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15828
#else
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15829
    errorCode = __MKSMALLINT(-1);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15830
#endif /* NO_NATIVE_DIALOGS */
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15831
%}.
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15832
    (errorCode notNil) ifTrue:[
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15833
	self primitiveFailed.
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 15834
	^ nil
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15835
    ].
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15836
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15837
    ^ answer
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15838
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15839
    "
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15840
     Display
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15841
	nativeMessageBoxFor:nil
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15842
	text:'Hello world'
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15843
	title:'Message'
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15844
	flags:#( OK APPLMODAL ICONSTOP )
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15845
	blocking:true
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15846
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15847
     Display
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15848
	nativeMessageBoxFor:nil
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15849
	text:'Hello world'
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15850
	title:'Message'
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15851
	flags:#( OK APPLMODAL ICONSTOP )
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15852
	blocking:false
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15853
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15854
     Display
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15855
	nativeMessageBoxFor:nil
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15856
	text:'Hello world'
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15857
	title:'Message'
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15858
	flags:#( ABORTRETRYIGNORE ICONSTOP )
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15859
	blocking:false
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 15860
    "
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15861
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15862
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15863
nativeWarnOK:aString title:titleString
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15864
     ^ self
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15865
	    nativeConfirm:aString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15866
	    title:titleString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15867
	    flags:#( APPLMODAL ICONSTOP OK)
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15868
	    initialAnswer:nil
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15869
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15870
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15871
      Screen current
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15872
	nativeWarnOK:'some warning' title:'Warning'
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15873
     "
4732
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15874
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15875
    "Modified: / 02-03-2007 / 15:37:47 / cg"
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15876
! !
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15877
4238
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15878
!WinWorkstation methodsFor:'native widget support'!
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15879
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15880
nativeDialogs
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15881
    ^ NativeDialogs ? false
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15882
!
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15883
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15884
nativeDialogs:aBoolean
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15885
    "enable / disable use of native dialogs.
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15886
     This is an experimental, unfinished, unsupported feature.
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15887
     For now, this only affects some file-, warning-, information and confirmation dialogs."
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15888
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15889
    NativeDialogs := aBoolean
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15890
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15891
    "
4240
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 15892
     Screen current nativeDialogs:true
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 15893
     Screen current nativeDialogs:false
4238
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15894
    "
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15895
!
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15896
4261
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 15897
nativeWidgets
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 15898
    ^ NativeWidgets ? false
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 15899
!
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 15900
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 15901
nativeWidgets:aBoolean
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 15902
    "enable / disable use of native widgets.
4238
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15903
     This is an experimental, unfinished, unsupported feature.
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15904
     For now, this only affects some widgets."
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15905
4261
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 15906
    NativeWidgets := aBoolean
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 15907
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 15908
    "
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 15909
     Screen current nativeWidgets:true
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 15910
     Screen current nativeWidgets:false
4238
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15911
    "
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15912
!
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15913
4263
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 15914
supportsNativeDialogs
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 15915
    ^ true
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 15916
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 15917
    "
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 15918
     Screen current supportsNativeDialogs
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 15919
    "
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 15920
!
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 15921
4238
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15922
supportsNativeWidgets
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15923
    ^ true
4240
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 15924
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 15925
    "
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 15926
     Screen current supportsNativeWidgets
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 15927
    "
4238
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15928
! !
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 15929
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15930
!WinWorkstation methodsFor:'pointer queries '!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15931
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15932
anyButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15933
    "return an integer for masking out any button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15934
     buttonStates value."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15935
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15936
    "/ should use ``Display buttonXMotionMask bitOr:....''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15937
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15938
%{  /* NOCONTEXT */
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 15939
    RETURN ( __MKSMALLINT(AnyButtonMask) );
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15940
%}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15941
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15942
    "Modified: 23.3.1996 / 12:41:33 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15943
    "Created: 23.3.1996 / 12:46:35 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15944
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15945
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15946
buttonStates
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15947
    "return an integer representing the state of the pointer buttons;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15948
     a one-bit in positions 0.. represent a pressed button.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15949
     See the button1Mask/button2Mask/button3Mask,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15950
     shiftMask/controlMask and modifierMask methods for the meaning of the bits."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15951
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15952
%{  /* NOCONTEXT */
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 15953
    int modifiers = 0;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 15954
    int b1m = Button1Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 15955
    int b3m = Button3Mask;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 15956
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 15957
    if (GetSystemMetrics(SM_SWAPBUTTON)) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 15958
	b3m = Button1Mask;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 15959
	b1m = Button3Mask;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 15960
    }
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 15961
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 15962
    if (GetAsyncKeyState(VK_LBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 15963
	modifiers |= b1m;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 15964
    if (GetAsyncKeyState(VK_MBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 15965
	modifiers |= Button2Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 15966
    if (GetAsyncKeyState(VK_RBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 15967
	modifiers |= b3m;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 15968
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15969
    RETURN (__MKSMALLINT(modifiers));
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15970
%}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15971
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15972
    "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15973
     Display buttonStates
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15974
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15975
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15976
    "is the control-key pressed ?
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15977
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15978
     Display buttonStates bitTest:(Display controlMask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15979
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15980
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15981
    "is the alt/meta-key pressed ?
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15982
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15983
     Display buttonStates bitTest:(Display altModifierMask)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15984
     Display buttonStates bitTest:(Display metaModifierMask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15985
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15986
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15987
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15988
leftButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15989
    "return an integer for masking out the left button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15990
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15991
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15992
    "/ should use ``Display button1MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15993
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15994
%{  /* NOCONTEXT */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15995
    RETURN ( __MKSMALLINT(Button1Mask) );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15996
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15997
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15998
    "Modified: 23.3.1996 / 12:41:33 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15999
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16000
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16001
middleButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16002
    "return an integer for masking out the middle button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16003
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16004
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16005
    "/ should use ``Display button2MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16006
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16007
%{  /* NOCONTEXT */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16008
    RETURN ( __MKSMALLINT(Button2Mask) );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16009
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16010
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16011
    "Modified: 23.3.1996 / 12:41:43 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16012
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16013
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16014
pointerPosition
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
 16015
    "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
 16016
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 16017
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16018
    POINT p;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16019
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16020
    if (! GetCursorPos(&p)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16021
	p.x = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16022
	p.y = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16023
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16024
    RETURN (__MKPOINT_INT(p.x, p.y));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16025
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16026
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16027
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16028
rightButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16029
    "return an integer for masking out the right button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16030
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16031
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16032
    "/ should use ``Display button3MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16033
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16034
%{  /* NOCONTEXT */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16035
    RETURN ( __MKSMALLINT(Button3Mask) );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16036
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16037
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16038
    "Modified: 23.3.1996 / 12:41:52 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16039
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16040
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16041
rootPositionOfLastEvent
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16042
    "return the position in root-window coordinates
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16043
     of the last button, key or pointer event"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16044
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 16045
%{  /* NOCONTEXT */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16046
    RETURN (__MKPOINT_INT(evRootX, evRootY));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16047
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16048
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16049
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16050
setPointerPosition:newPosition
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16051
    "change the pointer position in root-window coordinates."
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16052
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 16053
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16054
    if (__isPoint(newPosition)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16055
	OBJ xpos, ypos;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16056
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16057
	xpos = __point_X(newPosition);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16058
	ypos = __point_Y(newPosition);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16059
	if (__bothSmallInteger(xpos, ypos)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16060
	    SetCursorPos(__intVal(xpos), __intVal(ypos));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16061
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16062
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16063
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16064
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16065
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16066
setPointerPosition:newPosition in:aWindowId
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16067
    "change the pointer position to a new position relative to the
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16068
     given windows origin (which may be the rootWindow).
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16069
     Be careful with this - its usually not very ergonimically
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16070
     to change the mousePointer position.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16071
     This interface is provided for special applications (presentation
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16072
     playback) and should not be used in normal applications."
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16073
3895
31caf29bcda1 there is no setCursorPosition (?!)
Claus Gittinger <cg@exept.de>
parents: 3850
diff changeset
 16074
"/    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
 16075
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16076
5515
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16077
!WinWorkstation methodsFor:'private error handling'!
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16078
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16079
textOutFailed
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16080
    "mhmh - it seems the we should ignore this error - it sometimes happens when
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16081
     writing onto a window with a screen-saver just about to be activated...
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16082
     GetLastError is 5"
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16083
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16084
    "/ self error:'textOut failed'.
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16085
! !
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16086
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16087
!WinWorkstation methodsFor:'retrieving pixels'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16088
1461
6d8b022bfcd8 renamed getBitsFrom to getBitsFromId
Claus Gittinger <cg@exept.de>
parents: 1426
diff changeset
 16089
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
 16090
    "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
 16091
     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
 16092
     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
 16093
     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
 16094
     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
 16095
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16096
    |rawInfo info|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16097
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16098
    ((w <= 0) or:[h <= 0]) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16099
	self primitiveFailed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16100
	^ nil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16101
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16102
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16103
    rawInfo := Array new:11.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16104
		  "1 -> bit order"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16105
		  "2 -> depth"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16106
		  "3 -> bytes_per_line"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16107
		  "4 -> byte_order"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16108
		  "5 -> format"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16109
		  "6 -> bitmap_unit"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16110
		  "7 -> bitmap_pad"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16111
		  "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
 16112
		  "9 -> red_mask"
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16113
		  "10 -> green_mask"
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16114
		  "11 -> blue_mask"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16115
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16116
    "/ 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
 16117
    "/ unlimitedStack (some implementations use alloca and require huge amounts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16118
    "/ of temporary stack space
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16119
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16120
    (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
 16121
	info := IdentityDictionary new.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16122
	info at:#bitOrder put:(rawInfo at:1).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16123
	info at:#depth put:(rawInfo at:2).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16124
	info at:#bytesPerLine put:(rawInfo at:3).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16125
	info at:#byteOrder put:(rawInfo at:4).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16126
	info at:#format put:(rawInfo at:5).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16127
	info at:#bitmapUnit put:(rawInfo at:6).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16128
	info at:#bitmapPad put:(rawInfo at:7).
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16129
	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
 16130
	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
 16131
	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
 16132
	info at:#blueMask put:(rawInfo at:11).
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16133
	^ info
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16134
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16135
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16136
     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
 16137
     or is too small to hold the bits
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16138
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16139
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16140
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16141
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16142
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
 16143
    "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
 16144
     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
 16145
     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
 16146
     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
 16147
     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
 16148
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16149
    |rawInfo info|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16150
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16151
    ((w <= 0) or:[h <= 0]) ifTrue:[
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16152
	self primitiveFailed.
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16153
	^ nil
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16154
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16155
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16156
    rawInfo := Array new:11.
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16157
		  "1 -> bit order"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16158
		  "2 -> depth"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16159
		  "3 -> bytes_per_line"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16160
		  "4 -> byte_order"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16161
		  "5 -> format"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16162
		  "6 -> bitmap_unit"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16163
		  "7 -> bitmap_pad"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16164
		  "8 -> bits_per_pixel"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16165
		  "9 -> red_mask"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16166
		  "10 -> green_mask"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16167
		  "11 -> blue_mask"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16168
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16169
    "/ 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
 16170
    "/ 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
 16171
    "/ of temporary stack space
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16172
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16173
    (self primGetBitsFromPixmap:aDrawableId x:srcx y:srcy width:w height:h into:imageBits infoInto:rawInfo) ifTrue:[
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16174
	info := IdentityDictionary new.
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16175
	info at:#bitOrder put:(rawInfo at:1).
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16176
	info at:#depth put:(rawInfo at:2).
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16177
	info at:#bytesPerLine put:(rawInfo at:3).
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16178
	info at:#byteOrder put:(rawInfo at:4).
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16179
	info at:#format put:(rawInfo at:5).
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16180
	info at:#bitmapUnit put:(rawInfo at:6).
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16181
	info at:#bitmapPad put:(rawInfo at:7).
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16182
	info at:#bitsPerPixel put:(rawInfo at:8).
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16183
	info at:#redMask put:(rawInfo at:9).
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16184
	info at:#greenMask put:(rawInfo at:10).
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16185
	info at:#blueMask put:(rawInfo at:11).
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16186
	^ info
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16187
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16188
    "
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16189
     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
 16190
     or is too small to hold the bits
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16191
    "
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16192
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16193
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16194
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 16195
getPixelX:px y:py from:ignoredDrawableId with:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16196
    "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
 16197
     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
 16198
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16199
%{  /* NOCONTEXT */
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16200
    if (__isExternalAddress(aGCId)
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16201
     && __bothSmallInteger(px, py)) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16202
	struct gcData *gcData = _GCDATA(aGCId);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16203
	HDC hDC;
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16204
	int __x = __intVal(px), __y = __intVal(py);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16205
	int pixel;
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16206
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16207
	hDC = _getDC(gcData);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16208
	pixel = GetPixel(hDC, __x, __y);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16209
#ifndef CACHE_LAST_DC
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16210
	_releaseDC(gcData);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16211
#endif
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16212
	/*
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 16213
	 * for compatibility, returns the pixelValue
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16214
	 * from a monochrome bitmap
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16215
	 */
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16216
	if (gcData->hBitmap) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16217
	    if (gcData->bitmapColorBitCount == 1) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16218
		pixel = (pixel == 0) ? 0 : 1;
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16219
	    }
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16220
	}
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16221
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16222
	RETURN ( __MKSMALLINT(pixel & 0xFFFFFF) );
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16223
    }
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 16224
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16225
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16226
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16227
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16228
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
 16229
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16230
%{
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 16231
    int     height, width;
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 16232
    unsigned int numBytes;
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16233
    int     bytesPerRow;
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 16234
    HWND    hWnd;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16235
    HBITMAP hBitmap = 0;
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 16236
    HDC     bDC = 0;
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 16237
    struct {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 16238
	BITMAPINFOHEADER bmiHeader;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 16239
	DWORD r;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 16240
	DWORD g;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 16241
	DWORD b;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16242
    } bitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16243
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16244
    if (__isExternalAddress(aDrawableId)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16245
     && __bothSmallInteger(srcX, srcY)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16246
     && __bothSmallInteger(w, h)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16247
     && __isArray(info)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16248
     && __isByteArray(imageBits))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16249
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16250
	hWnd = _HWNDVal( aDrawableId );
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16251
	BMDPRINTF(("primGetBits %x\n",hWnd));
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16252
	if( hWnd != 0 ) {
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 16253
	    HDC wDC;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 16254
	    HANDLE prevBitmap;
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16255
	    int widthRoundedUpToNextMultipleOf4 = ((width + 3 ) / 4) * 4;
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16256
	    int widthUsed;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 16257
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16258
	    bDC = CreateCompatibleDC(__rootDC);
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 16259
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16260
	    BMDPRINTF(("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
 16261
	    height =  __intVal(h);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16262
	    width  =  __intVal(w);
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16263
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16264
	    widthUsed = widthRoundedUpToNextMultipleOf4;
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16265
	    widthUsed = width;
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16266
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16267
	    BMDPRINTF(("width %d height %d\n",width,height));
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16268
	    hBitmap = CreateCompatibleBitmap(__rootDC, widthUsed, height);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16269
	    if (!hBitmap)
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16270
		goto fail;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16271
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16272
	    bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16273
	    bitmap.bmiHeader.biPlanes = 1;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 16274
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 16275
	    bitmap.bmiHeader.biCompression = BI_RGB;
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16276
	    bytesPerRow = (((width*3) + 3 ) / 4) * 4;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 16277
#else
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16278
	    if (__depth == 24) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16279
		bitmap.bmiHeader.biCompression = BI_RGB;
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16280
		bytesPerRow = (((width*3) + 3 ) / 4) * 4;
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16281
	    } else if (__depth == 16) {
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 16282
# if 0
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16283
		bitmap.bmiHeader.biCompression = BI_BITFIELDS;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16284
		bitmap.b = 0x001f;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16285
		bitmap.g = 0x07e0;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16286
		bitmap.r = 0xf800;
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16287
		bytesPerRow = (((width*2) + 1 ) / 4) * 4;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 16288
# else
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16289
		bitmap.b = 0;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16290
		bitmap.g = 0;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16291
		bitmap.r = 0;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16292
		bitmap.bmiHeader.biCompression = BI_RGB;
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16293
		bytesPerRow = (((width*3) + 3 ) / 4) * 4;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 16294
# endif
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 16295
	    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 16296
#endif /* ALWAYSTRUECOLOR */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16297
	    bitmap.bmiHeader.biSizeImage = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16298
	    bitmap.bmiHeader.biXPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16299
	    bitmap.bmiHeader.biYPelsPerMeter = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16300
	    bitmap.bmiHeader.biClrUsed = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16301
	    bitmap.bmiHeader.biClrImportant = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16302
	    bitmap.bmiHeader.biBitCount = __depth;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16303
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16304
	    bitmap.bmiHeader.biWidth = widthUsed;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16305
	    bitmap.bmiHeader.biHeight = -height;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16306
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 16307
	    wDC = GetDC(hWnd);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 16308
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 16309
	    SelectObject(bDC, hBitmap);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16310
	    if (BitBlt(bDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16311
		   0,0,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16312
		   width,height,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16313
		   wDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16314
		   __intVal(srcX), __intVal(srcY),
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16315
		   SRCCOPY)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16316
		 == 0
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16317
		)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16318
	    {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 16319
		INFOFPRINTF((stderr, "WinWorkstation [warning]: in primGetBitsFrom: BitBlt\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16320
	    }
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 16321
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 16322
#ifdef CACHE_LAST_DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 16323
	    if (lastGcData && (lastGcData->_hDC == wDC)) {
2732
bb3d3b26a81c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2728
diff changeset
 16324
# ifdef DEBUG_DC_REUSE
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 16325
		console_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
 16326
# endif
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 16327
	    } else
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 16328
#endif
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 16329
#ifdef CACHE_LAST_WM_PAINT_DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 16330
	    if (last_wm_paint_dc && (last_wm_paint_dc == wDC)) {
2732
bb3d3b26a81c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2728
diff changeset
 16331
# ifdef DEBUG_DC_REUSE
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 16332
		console_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
 16333
# endif
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 16334
	    } else
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 16335
#endif
2711
11b5c243693c memory leak (DC-leak), when bitmap creation failed.
Claus Gittinger <cg@exept.de>
parents: 2706
diff changeset
 16336
	    ReleaseDC(hWnd, wDC);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 16337
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 16338
	    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
 16339
	    {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 16340
		INFOFPRINTF((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
 16341
		goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16342
	    }
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16343
	    BMDPRINTF(("bitmap info:%d %d %d %d\n",
3553
5a51330ea94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3548
diff changeset
 16344
			bitmap.bmiHeader.biWidth, bitmap.bmiHeader.biHeight,
5a51330ea94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3548
diff changeset
 16345
			bitmap.bmiHeader.biBitCount, bitmap.bmiHeader.biSizeImage));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16346
	    numBytes = bitmap.bmiHeader.biSizeImage;
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16347
	    if( numBytes != 0 ) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16348
		if (numBytes > __byteArraySize(imageBits)) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16349
		    /* imageBits too small */
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 16350
		    INFOFPRINTF((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
 16351
				__byteArraySize(imageBits), numBytes,
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16352
				bitmap.bmiHeader.biWidth, -bitmap.bmiHeader.biHeight
3553
5a51330ea94a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3548
diff changeset
 16353
			     ));
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16354
		    goto fail;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16355
		}
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16356
		BMDPRINTF(("numBytes %d\n",numBytes));
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16357
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16358
		bitmap.bmiHeader.biHeight = -height;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16359
		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
 16360
		{
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 16361
		    INFOFPRINTF((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
 16362
		    goto fail;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16363
		}
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16364
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16365
		/* 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
 16366
		{
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16367
		    char *cp = __ByteArrayInstPtr(imageBits)->ba_element;
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16368
#ifdef PRE_18_FEB_05
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16369
		    int n = numBytes;
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16370
		    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
 16371
			  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
 16372
			  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
 16373
			  cp[2] = b;
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16374
		    }
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16375
#else
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16376
		    int h;
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16377
		    char *rowp = cp;
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16378
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16379
		    for (h=height; h>0; h--) {
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16380
			int w;
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16381
			char *pixel = rowp;
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16382
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16383
			for (w=width; w>0; w--) {
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16384
			    char b;
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16385
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16386
			    b = pixel[0];
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16387
			    pixel[0] = pixel[2];
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16388
			    pixel[2] = b;
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16389
			    pixel += 3;
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16390
			};
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16391
			rowp += bytesPerRow;
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16392
		    };
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16393
#endif
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16394
		}
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16395
	    } else {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 16396
		INFOFPRINTF((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
 16397
		goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16398
	    }
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16399
	} else {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 16400
	    INFOFPRINTF((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
 16401
	    goto fail;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16402
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16403
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16404
	__ArrayInstPtr(info)->a_element[0] = @symbol(msbFirst);                                 // bitOrder
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16405
	__ArrayInstPtr(info)->a_element[1] = __MKSMALLINT(1);                                   // depth
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16406
#ifdef PRE_18_FEB_05
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16407
	__ArrayInstPtr(info)->a_element[2] = __MKSMALLINT(numBytes/height); //__MKSMALLINT(widthRoundedUpToNextMultipleOf4);    // bytesPerLine
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16408
#else
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16409
	__ArrayInstPtr(info)->a_element[2] = __MKSMALLINT(bytesPerRow);                         // bytesPerLine
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16410
#endif
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16411
	__ArrayInstPtr(info)->a_element[3] = @symbol(msbFirst);                                 // byteOrder
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16412
	__ArrayInstPtr(info)->a_element[4] = @symbol(XYPixmap);                                 // format
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16413
	__ArrayInstPtr(info)->a_element[5] = __MKSMALLINT(0);                                   // bitmapUnit
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16414
	__ArrayInstPtr(info)->a_element[6] = __MKSMALLINT(WIN32PADDING);                        // bitmapPad
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
 16415
	__ArrayInstPtr(info)->a_element[7] = __MKSMALLINT(bitmap.bmiHeader.biBitCount);         // bitsPerPixel
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16416
	__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
 16417
	__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
 16418
	__ArrayInstPtr(info)->a_element[10] = __MKSMALLINT(0xFF0000);  // blueMask
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16419
	if (bDC)
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16420
	    DeleteDC(bDC);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16421
	if (hBitmap)
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 16422
	    _DeleteObject(hBitmap, __LINE__);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16423
	RETURN ( true );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16424
    }
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16425
fail: ;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16426
    if (bDC)
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 16427
	DeleteDC(bDC);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16428
    if (hBitmap)
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 16429
	_DeleteObject(hBitmap, __LINE__);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16430
%}.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16431
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16432
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16433
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16434
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
 16435
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16436
%{
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 16437
    int            height, width;
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 16438
    unsigned int   numBytes;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 16439
    unsigned char* ep = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16440
    HBITMAP        xBitmap;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16441
    HBITMAP hBitmap = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16442
    HDC bDC = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16443
    HDC xDC = 0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16444
    struct
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16445
    {
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16446
	BITMAPINFOHEADER bmiHeader;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16447
	DWORD rgb[2];
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16448
    } bitmap;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16449
    BITMAP bitmapInfo;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16450
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16451
    if (__isExternalAddress(aDrawableId)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16452
     && __bothSmallInteger(srcX, srcY)
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 16453
     && __bothSmallInteger(w, h)
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 16454
     && __isArray(info)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16455
     && __isByteArray(imageBits))
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16456
    {
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16457
	xBitmap = _HBITMAPVAL( aDrawableId );
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16458
	BMDPRINTF(("primGetBitsFromPixmap %x\n",xBitmap));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16459
	if (xBitmap != 0) {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16460
	    xDC = GetDC(0);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16461
	    SelectObject(xDC, xBitmap);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16462
	    GetObject(xBitmap,sizeof(bitmapInfo),&bitmapInfo);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16463
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16464
	    bDC = CreateCompatibleDC(__rootDC);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16465
	    BMDPRINTF(("srcX %d srcY %d w %d h %d\n",__intVal(srcX),__intVal(srcY),__intVal(w),__intVal(h)));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16466
	    height =  __intVal(h);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16467
	    width  =  __intVal(w);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16468
	    BMDPRINTF(("width %d height %d\n",width,height));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16469
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16470
	    hBitmap = CreateCompatibleBitmap(xDC, width, height);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16471
	    if (!hBitmap)
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16472
		goto fail;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16473
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16474
	    SelectObject(bDC,hBitmap);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16475
	    if (BitBlt(bDC,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16476
		   0,0,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16477
		   width,height,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16478
		   xDC,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16479
		   __intVal(srcX), __intVal(srcY),
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16480
		   SRCCOPY)
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16481
		 == 0
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16482
		)
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16483
	    {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16484
		 BMDPRINTF(("ERROR in primGetBitsFromPixmap: BitBlt\n"));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16485
		 goto fail;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16486
	    }
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16487
	    bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16488
	    bitmap.bmiHeader.biPlanes = 1;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 16489
#ifdef ALWAYSTRUECOLOR
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16490
	    bitmap.bmiHeader.biCompression = BI_RGB;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16491
#else
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16492
	    if (__depth == 24) {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16493
		/*bitmap.bmiHeader.biCompression = BI_BITFIELDS;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16494
		bitmap.r = 0xff0000;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16495
		bitmap.g = 0x00ff00;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16496
		bitmap.b = 0x0000ff;*/
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16497
		bitmap.bmiHeader.biCompression = BI_RGB;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16498
	    } else if (__depth == 16) {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16499
		/*bitmap.bmiHeader.biCompression = BI_RGB;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16500
		bitmap.bmiHeader.biCompression = BI_BITFIELDS;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16501
		bitmap.b = 0x001f;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16502
		bitmap.g = 0x07e0;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16503
		bitmap.r = 0xf800;*/
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16504
		bitmap.bmiHeader.biCompression = BI_RGB;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16505
	    } else {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16506
		BMDPRINTF(("primGetBitsFromPixmap: unsupported depth\n"));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16507
		got fail;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16508
	    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 16509
#endif /* ALWAYSTRUECOLOR */
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16510
	    bitmap.bmiHeader.biSizeImage = 0;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16511
	    bitmap.bmiHeader.biXPelsPerMeter = 0;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16512
	    bitmap.bmiHeader.biYPelsPerMeter = 0;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16513
	    bitmap.bmiHeader.biClrUsed = 0;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16514
	    bitmap.bmiHeader.biClrImportant = 0;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16515
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16516
	    bitmap.bmiHeader.biWidth = width;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16517
	    bitmap.bmiHeader.biHeight = -height;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16518
	    bitmap.bmiHeader.biBitCount = bitmapInfo.bmBitsPixel;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16519
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16520
	    if (GetDIBits(bDC,hBitmap,0,height,0,(struct tagBITMAPINFO *)&bitmap,DIB_RGB_COLORS) == 0)
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16521
	    {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16522
		BMDPRINTF(("noinfo returned\n"));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16523
		goto fail;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16524
	    }
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16525
	    BMDPRINTF(("bitmap info:%d %d %d %d\n",bitmap.bmiHeader.biWidth,bitmap.bmiHeader.biHeight,bitmap.bmiHeader.biBitCount,bitmap.bmiHeader.biSizeImage));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16526
	    numBytes = bitmap.bmiHeader.biSizeImage;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16527
	    if ( numBytes != 0 ) {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16528
		if (numBytes > __byteArraySize(imageBits)) {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16529
		    /* imageBits too small */
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16530
		    BMDPRINTF(("provided byteArray too small\n"));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16531
		    goto fail;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16532
		}
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16533
		BMDPRINTF(("numBytes %d\n",numBytes));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16534
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16535
		bitmap.bmiHeader.biHeight = -height;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16536
		bitmap.bmiHeader.biBitCount = bitmapInfo.bmBitsPixel; /*__depth;*/
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16537
		bitmap.rgb[0] = 0;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16538
		bitmap.rgb[1] = 0xffffff;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16539
		if (GetDIBits(xDC,xBitmap,0,height,__ByteArrayInstPtr(imageBits)->ba_element,(struct tagBITMAPINFO *)&bitmap,DIB_RGB_COLORS) == 0)
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16540
		{
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16541
		    BMDPRINTF(("zero bits returned\n"));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16542
		    goto fail;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16543
		}
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16544
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16545
#if 0
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16546
		{
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16547
		    /* swap red and blue (windows delivers BGR) */
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16548
		    char *cp = __ByteArrayInstPtr(imageBits)->ba_element;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16549
		    int n = numBytes;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16550
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16551
		    for ( ;n > 0; n -= 3, cp += 3) {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16552
			  char b = cp[0];
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16553
			  cp[0] = cp[2];
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16554
			  cp[2] = b;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16555
		    }
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16556
		}
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16557
#endif
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16558
	    } else {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16559
		BMDPRINTF(("unacceptable bitmap\n"));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16560
		goto fail;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16561
	    }
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16562
	} else {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16563
	    BMDPRINTF(("unacceptable bitmap\n"));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16564
	    goto fail;
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16565
	}
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16566
	__ArrayInstPtr(info)->a_element[0] = @symbol(msbFirst);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16567
	__ArrayInstPtr(info)->a_element[1] = __MKSMALLINT(1);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16568
	__ArrayInstPtr(info)->a_element[2] = __MKSMALLINT(numBytes/height);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16569
	__ArrayInstPtr(info)->a_element[3] = @symbol(lsbFirst);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16570
	__ArrayInstPtr(info)->a_element[4] = (bitmap.bmiHeader.biBitCount == 1) ? @symbol(ZPixmap) : @symbol(XYPixmap);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16571
	__ArrayInstPtr(info)->a_element[5] = __MKSMALLINT(0);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16572
	__ArrayInstPtr(info)->a_element[6] = __MKSMALLINT(WIN32PADDING);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16573
	__ArrayInstPtr(info)->a_element[7] = __MKSMALLINT(bitmap.bmiHeader.biBitCount);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16574
	__ArrayInstPtr(info)->a_element[8] = __MKSMALLINT(0xFF0000);   // redMask
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16575
	__ArrayInstPtr(info)->a_element[9] = __MKSMALLINT(0x00FF00);   // greenMask
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16576
	__ArrayInstPtr(info)->a_element[10] = __MKSMALLINT(0x0000FF);  // blueMask
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16577
	if (bDC)
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16578
	    DeleteDC(bDC);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16579
	if (xDC)
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16580
	    ReleaseDC(0, xDC); //DeleteDC(xDC);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16581
	if (hBitmap)
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16582
	    DeleteObject(hBitmap);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16583
	RETURN ( true );
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 16584
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16585
fail:
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16586
    if (bDC)
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16587
	DeleteDC(bDC);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16588
    if (xDC)
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16589
	ReleaseDC(0, xDC); //DeleteDC(xDC);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16590
    if (hBitmap)
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 16591
	DeleteObject(hBitmap);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16592
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 16593
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16594
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16595
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16596
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16597
!WinWorkstation methodsFor:'style defaults'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16598
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16599
defaultStyleValueFor:aKey
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16600
    "return a default style value, given a key.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16601
     These defaults are used if nothing is specified
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16602
     in the style sheet
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16603
     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
 16604
     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
 16605
     where the systemDefaults are used ..."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16606
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16607
    |clr|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16608
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16609
"/    aKey == #shadowColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16610
"/        ^ Color black
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16611
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16612
"/    aKey == #lightColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16613
"/        ^ Color white
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16614
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16615
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16616
    aKey == #viewBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16617
	clr := self getSystemColor:#COLOR_WINDOW.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16618
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16619
    aKey == #textForegroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16620
	clr := self getSystemColor:#COLOR_WINDOWTEXT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16621
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16622
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16623
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16624
"/    aKey == #scrollerViewBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16625
"/        ^ Color white
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16626
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16627
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16628
"/    aKey == #textBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16629
"/        ^ Color white.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16630
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16631
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16632
    clr notNil ifTrue:[^ clr].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16633
    ^ super defaultStyleValueFor:aKey
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16634
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16635
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16636
!WinWorkstation methodsFor:'tray access'!
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16637
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16638
addTrayIconFor:aView
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16639
	icon:wicon iconMask:wiconMaskArg
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16640
	toolTipMessage:toolTipMessageArg
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16641
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16642
    "add an icon to the tray for aView (which will receive tray-events in the future.
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16643
     The icon, mask and toolTopText are optional.
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16644
     Windows places a limit of 63 characters to the tooltip - so dont be to chatty here..."
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16645
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16646
    |windowId wiconId wiconMask invertedWiconMask wiconMaskId
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16647
     wiconWidth wiconHeight toolTipMessage|
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16648
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16649
    "/ the toolTop string cannot be longer than 64 characters including the NULL terminator
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16650
    toolTipMessageArg size > 63 ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16651
	toolTipMessage := toolTipMessageArg copyTo:63
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16652
    ] ifFalse:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16653
	toolTipMessage := toolTipMessageArg.
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16654
    ].
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16655
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16656
    windowId := aView id.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16657
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16658
    wicon notNil ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16659
	wiconId := (wicon asFormOn:self) id.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16660
	wiconHeight := wicon height.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16661
	wiconWidth  := wicon width.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16662
	wiconMask := wiconMaskArg.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16663
	wiconMask isNil ifTrue:[
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16664
	    wiconMask := wicon mask.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16665
	].
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16666
	wiconMask notNil ifTrue:[
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16667
	    "/ WIN32's mask has zeros for opaque pixels
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16668
	    invertedWiconMask := wiconMask copy.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16669
	    invertedWiconMask bits invert.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16670
	    invertedWiconMask := invertedWiconMask onDevice:self.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16671
	    wiconMaskId := invertedWiconMask id
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16672
	].
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16673
    ].
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16674
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16675
%{  /* STACK: 20000 */
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16676
#ifndef WM_TRAY_MESSAGE
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16677
# define WM_TRAY_MESSAGE (WM_USER+0x200)
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16678
#endif
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16679
    HBITMAP        xBitMap, maskBitmap;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16680
    HICON          xIcon = (HICON)0;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16681
    ICONINFO       iconInfo;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16682
    NOTIFYICONDATA nid;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16683
    unsigned char fastBits[10000];
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16684
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16685
    /* get bitmap for icon */
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16686
    if ( __isExternalAddress(wiconId) ) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16687
	xBitMap = _HBITMAPVAL( wiconId );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16688
	if ( xBitMap != 0 ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16689
	    BITMAP bm;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16690
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16691
	    if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16692
		int d = bm.bmPlanes * bm.bmBitsPixel;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16693
		BYTE *ep;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16694
		int height, width;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16695
		int nBytes;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16696
		unsigned char *allocatedBits = 0;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16697
		int privateMask = 0;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16698
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16699
		if ( __isExternalAddress(wiconMaskId) ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16700
		    maskBitmap = _HBITMAPVAL( wiconMaskId );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16701
		} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16702
		    if (wiconMaskId != nil) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16703
			PRINTF(("WinWorkstat [warning]: wiconMaskId is not an external address\n"));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16704
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16705
		    maskBitmap = 0;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16706
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16707
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16708
		/*
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16709
		 * if there is no mask, generate one
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16710
		 */
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16711
		if (maskBitmap == 0) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16712
		    DPRINTF(("Bitmap w:%d h:%d p:%d d:%d\n",bm.bmWidth,bm.bmHeight,bm.bmPlanes,bm.bmBitsPixel));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16713
		    height = __intVal( wiconHeight );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16714
		    width  = __intVal( wiconWidth  );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16715
		    nBytes = ( width + 15 ) / 8;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16716
		    nBytes = height * nBytes;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16717
		    if (nBytes < sizeof(fastBits)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16718
			ep = fastBits;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16719
		    } else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16720
			ep = allocatedBits = (unsigned char *) malloc(nBytes);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16721
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16722
		    if ( ep == 0 ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16723
			PRINTF(( "WinWorkstat [warning]: malloc failed\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16724
		    } else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16725
			memset(ep, 0, nBytes);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16726
			maskBitmap = CreateBitmap(width, height, 1, 1, ep );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16727
			if ( maskBitmap == NULL ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16728
			    PRINTF(( "WinWorkstat [warning]: mask CREATION failed\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16729
			} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16730
			    privateMask = 1;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16731
			}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16732
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16733
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16734
		if ( maskBitmap != NULL ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16735
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16736
		    iconInfo.fIcon = TRUE;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16737
		    iconInfo.hbmMask  = maskBitmap;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16738
		    iconInfo.hbmColor = xBitMap;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16739
		    xIcon = CreateIconIndirect( &iconInfo );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16740
		    if (privateMask) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16741
			DeleteObject( maskBitmap );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16742
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16743
		} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16744
		    PRINTF(( "WinWorkstat [warning]: no mask for icon !\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16745
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16746
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16747
		if (allocatedBits) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16748
		    free(allocatedBits);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16749
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16750
	    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16751
	} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16752
	    DPRINTF(("WinWorkstat [warning]: xBitMap is zero \n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16753
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16754
    } else {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16755
	if (wiconId != nil) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16756
	    PRINTF(("WinWorkstat [warning]: wiconId is not an external address\n"));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16757
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16758
    }
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16759
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16760
    ZeroMemory(&nid, sizeof(NOTIFYICONDATA));
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16761
    nid.cbSize = sizeof(NOTIFYICONDATA);
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16762
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16763
    if (__isExternalAddress(windowId)) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16764
	HWND hwnd = _HWNDVal(windowId);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16765
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16766
	if (hwnd && IsWindow(hwnd)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16767
	    nid.hWnd = hwnd; //the hWnd and uID members allow the OS to uniquely identify your icon.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16768
			     // One window (the hWnd) can have more than one icon, as long as they have unique uIDs.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16769
	    nid.uFlags =
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16770
		NIF_ICON        //we're adding an icon
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16771
		| NIF_MESSAGE   //we want the tray to send a message to the window identified by hWnd when something happens to our icon (see uCallbackMesage member below).
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16772
		| NIF_TIP;      //our icon has a tooltip.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16773
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16774
	    nid.uCallbackMessage = WM_TRAY_MESSAGE; //this message must be handled in hwnd's window procedure. more info below.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16775
	    if (xIcon) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16776
		nid.hIcon   = xIcon;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16777
		/* wc.hIconSm = wiconId; In 4.x there are large and small icons */
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16778
	    } else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16779
		nid.hIcon = NULL;        /* THIS MUST BE NULL TO DELETE ICONS */
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16780
	    }
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 16781
	    if (__isStringLike(toolTipMessage)) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16782
		strcpy(nid.szTip, __stringVal(toolTipMessage));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16783
	    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16784
	    Shell_NotifyIcon(NIM_ADD, &nid);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16785
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16786
    }
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16787
%}
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16788
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16789
    "
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16790
     |v icon|
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16791
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16792
     v := StandardSystemView new.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16793
     v openAndWait.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16794
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16795
     icon := Icon stxIcon.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16796
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16797
	  addTrayIconFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16798
	  icon:icon iconMask:nil
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16799
	  toolTipMessage:'Hi There'
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16800
    "
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16801
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16802
    "Created: / 31-10-2007 / 01:51:49 / cg"
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16803
    "Modified: / 05-11-2007 / 12:18:54 / cg"
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16804
!
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16805
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16806
removeTrayIconFor:aView
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16807
    "remove the tray icon"
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16808
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16809
    |windowId wiconId wiconMask invertedWiconMask wiconMaskId
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16810
     wiconWidth wiconHeight|
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16811
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16812
    windowId := aView id.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16813
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16814
%{  /* STACK: 20000 */
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16815
#ifndef WM_TRAY_MESSAGE
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16816
# define WM_TRAY_MESSAGE (WM_USER+0x200)
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16817
#endif
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16818
    NOTIFYICONDATA nid;
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16819
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16820
    ZeroMemory(&nid, sizeof(NOTIFYICONDATA));
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16821
    nid.cbSize = sizeof(NOTIFYICONDATA);
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16822
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16823
    if (__isExternalAddress(windowId)) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16824
	HWND hwnd = _HWNDVal(windowId);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16825
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16826
	if (hwnd && IsWindow(hwnd)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16827
	    nid.hWnd = hwnd;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16828
	    Shell_NotifyIcon(NIM_DELETE, &nid);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16829
	}
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16830
    }
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16831
%}
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16832
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16833
    "
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16834
     |v icon|
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16835
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16836
     v := StandardSystemView new.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16837
     v openAndWait.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16838
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16839
     icon := Icon stxIcon.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16840
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16841
	  addTrayIconFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16842
	  icon:icon iconMask:nil
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16843
	  toolTipMessage:'Hi There'.
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16844
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16845
     Delay waitForSeconds:3.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16846
     icon := Tools::NewSystemBrowser defaultIcon.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16847
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16848
	  setTrayIconFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16849
	  icon:icon iconMask:nil.
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16850
     Delay waitForSeconds:3.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16851
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16852
	    removeTrayIconFor:v.
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16853
    "
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16854
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16855
    "Created: / 05-11-2007 / 12:17:17 / cg"
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16856
!
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16857
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16858
setTrayIconFor:aView icon:wicon iconMask:wiconMaskArg
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 16859
    "change the tray icon"
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16860
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16861
    |windowId wiconId wiconMask invertedWiconMask wiconMaskId
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16862
     wiconWidth wiconHeight|
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16863
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16864
    windowId := aView id.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16865
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16866
    wicon notNil ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16867
	wiconId := (wicon asFormOn:self) id.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16868
	wiconHeight := wicon height.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16869
	wiconWidth  := wicon width.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16870
	wiconMask := wiconMaskArg.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16871
	wiconMask isNil ifTrue:[
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16872
	    wiconMask := wicon mask.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16873
	].
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16874
	wiconMask notNil ifTrue:[
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16875
	    "/ WIN32's mask has zeros for opaque pixels
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16876
	    invertedWiconMask := wiconMask copy.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16877
	    invertedWiconMask bits invert.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16878
	    invertedWiconMask := invertedWiconMask onDevice:self.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16879
	    wiconMaskId := invertedWiconMask id
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16880
	].
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16881
    ].
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16882
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16883
%{  /* STACK: 20000 */
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16884
#ifndef WM_TRAY_MESSAGE
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16885
# define WM_TRAY_MESSAGE (WM_USER+0x200)
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16886
#endif
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16887
    HBITMAP        xBitMap, maskBitmap;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16888
    HICON          xIcon = (HICON)0;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16889
    ICONINFO       iconInfo;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16890
    NOTIFYICONDATA nid;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16891
    unsigned char fastBits[10000];
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16892
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16893
    /* get bitmap for icon */
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16894
    if ( __isExternalAddress(wiconId) ) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16895
	xBitMap = _HBITMAPVAL( wiconId );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16896
	if ( xBitMap != 0 ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16897
	    BITMAP bm;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16898
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16899
	    if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16900
		int d = bm.bmPlanes * bm.bmBitsPixel;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16901
		BYTE *ep;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16902
		int height, width;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16903
		int nBytes;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16904
		unsigned char *allocatedBits = 0;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16905
		int privateMask = 0;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16906
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16907
		if ( __isExternalAddress(wiconMaskId) ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16908
		    maskBitmap = _HBITMAPVAL( wiconMaskId );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16909
		} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16910
		    if (wiconMaskId != nil) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16911
			PRINTF(("WinWorkstat [warning]: wiconMaskId is not an external address\n"));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16912
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16913
		    maskBitmap = 0;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16914
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16915
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16916
		/*
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16917
		 * if there is no mask, generate one
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16918
		 */
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16919
		if (maskBitmap == 0) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16920
		    DPRINTF(("Bitmap w:%d h:%d p:%d d:%d\n",bm.bmWidth,bm.bmHeight,bm.bmPlanes,bm.bmBitsPixel));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16921
		    height = __intVal( wiconHeight );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16922
		    width  = __intVal( wiconWidth  );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16923
		    nBytes = ( width + 15 ) / 8;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16924
		    nBytes = height * nBytes;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16925
		    if (nBytes < sizeof(fastBits)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16926
			ep = fastBits;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16927
		    } else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16928
			ep = allocatedBits = (unsigned char *) malloc(nBytes);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16929
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16930
		    if ( ep == 0 ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16931
			PRINTF(( "WinWorkstat [warning]: malloc failed\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16932
		    } else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16933
			memset(ep, 0, nBytes);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16934
			maskBitmap = CreateBitmap(width, height, 1, 1, ep );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16935
			if ( maskBitmap == NULL ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16936
			    PRINTF(( "WinWorkstat [warning]: mask CREATION failed\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16937
			} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16938
			    privateMask = 1;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16939
			}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16940
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16941
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16942
		if ( maskBitmap != NULL ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16943
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16944
		    iconInfo.fIcon = TRUE;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16945
		    iconInfo.hbmMask  = maskBitmap;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16946
		    iconInfo.hbmColor = xBitMap;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16947
		    xIcon = CreateIconIndirect( &iconInfo );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16948
		    if (privateMask) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16949
			DeleteObject( maskBitmap );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16950
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16951
		} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16952
		    PRINTF(( "WinWorkstat [warning]: no mask for icon !\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16953
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16954
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16955
		if (allocatedBits) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16956
		    free(allocatedBits);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16957
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16958
	    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16959
	} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16960
	    DPRINTF(("WinWorkstat [warning]: xBitMap is zero \n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16961
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16962
    } else {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16963
	if (wiconId != nil) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16964
	    PRINTF(("WinWorkstat [warning]: wiconId is not an external address\n"));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16965
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16966
    }
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16967
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16968
    ZeroMemory(&nid, sizeof(NOTIFYICONDATA));
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16969
    nid.cbSize = sizeof(NOTIFYICONDATA);
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16970
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16971
    if (__isExternalAddress(windowId)) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16972
	HWND hwnd = _HWNDVal(windowId);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16973
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16974
	if (hwnd && IsWindow(hwnd)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16975
	    nid.hWnd = hwnd; //the hWnd and uID members allow the OS to uniquely identify your icon.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16976
			     // One window (the hWnd) can have more than one icon, as long as they have unique uIDs.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16977
	    nid.uFlags = NIF_ICON;      //our icon has a tooltip.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16978
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16979
	    if (xIcon) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16980
		nid.hIcon   = xIcon;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16981
		/* wc.hIconSm = wiconId; In 4.x there are large and small icons */
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16982
	    } else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16983
		nid.hIcon = NULL;        /* THIS MUST BE NULL TO DELETE ICONS */
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16984
	    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16985
	    Shell_NotifyIcon(NIM_MODIFY, &nid);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16986
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16987
    }
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16988
%}
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16989
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16990
    "
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16991
     |v icon|
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16992
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16993
     v := StandardSystemView new.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16994
     v openAndWait.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16995
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16996
     icon := Icon stxIcon.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 16997
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16998
	  addTrayIconFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16999
	  icon:icon iconMask:nil
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17000
	  toolTipMessage:'Hi There'.
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17001
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17002
     Delay waitForSeconds:3.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17003
     icon := Tools::NewSystemBrowser defaultIcon.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17004
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17005
	  setTrayIconFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17006
	  icon:icon iconMask:nil.
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17007
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17008
    "
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17009
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17010
    "Created: / 31-10-2007 / 11:41:33 / cg"
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17011
    "Modified: / 05-11-2007 / 12:19:12 / cg"
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17012
!
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17013
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17014
setTrayIconsToolTipMessageFor:aView to:toolTipMessageArg
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17015
    "Change the toolTopText.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17016
     Windows seems to have a bug here, in that while being shown,
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17017
     a change of the toolTipText is not immediately visible
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17018
     (i.e. the new text will appear when the current toolTip view is hidden
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17019
     and reopened)
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17020
     Windows places a limit of 63 characters to the tooltip - so dont be to chatty here..."
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17021
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17022
    |windowId wiconId wiconMask invertedWiconMask wiconMaskId
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17023
     wiconWidth wiconHeight toolTipMessage|
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17024
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17025
    "/ the toolTop string cannot be longer than 64 characters including the NULL terminator
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17026
    toolTipMessageArg size > 63 ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17027
	toolTipMessage := toolTipMessageArg copyTo:63
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17028
    ] ifFalse:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17029
	toolTipMessage := toolTipMessageArg.
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17030
    ].
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17031
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17032
    windowId := aView id.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17033
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17034
%{  /* STACK: 20000 */
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17035
    NOTIFYICONDATA nid;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17036
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17037
    ZeroMemory(&nid, sizeof(NOTIFYICONDATA));
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17038
    nid.cbSize = sizeof(NOTIFYICONDATA);
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17039
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17040
    if (__isExternalAddress(windowId)) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17041
	HWND hwnd = _HWNDVal(windowId);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17042
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17043
	if (hwnd && IsWindow(hwnd)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17044
	    nid.hWnd = hwnd; //the hWnd and uID members allow the OS to uniquely identify your icon.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17045
			     // One window (the hWnd) can have more than one icon, as long as they have unique uIDs.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17046
	    nid.uFlags = NIF_TIP;    //change the tooltip.
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 17047
	    if (__isStringLike(toolTipMessage)) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17048
		strcpy(nid.szTip, __stringVal(toolTipMessage));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17049
	    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17050
	    Shell_NotifyIcon(NIM_MODIFY, &nid);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17051
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17052
    }
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17053
%}
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17054
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17055
    "
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17056
     |v icon|
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17057
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17058
     v := StandardSystemView new.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17059
     v openAndWait.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17060
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17061
     icon := Icon stxIcon.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17062
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17063
	  addTrayIconFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17064
	  icon:icon iconMask:nil
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17065
	  toolTipMessage:'Hi There'.
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17066
     1 to:5 do:[:i |
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17067
	 Delay waitForSeconds:2.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17068
	 Screen current
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17069
	      setTrayIconsToolTipMessageFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17070
	      to:(i printString).
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17071
     ].
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17072
     v destroy.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17073
    "
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17074
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17075
    "Created: / 31-10-2007 / 11:25:49 / cg"
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17076
    "Modified: / 05-11-2007 / 12:20:53 / cg"
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17077
! !
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17078
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17079
!WinWorkstation methodsFor:'window stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17080
4792
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17081
activateWindow1:aWindowId
4523
df48174867cc Do not collapse a maximized window on #activate:
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
 17082
    "make a window active (so that it gets the focus)"
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 17083
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17084
%{  /* NOCONTEXT */
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 17085
    if (__isExternalAddress(aWindowId)) {
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17086
	HWND win = _HWNDVal(aWindowId);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17087
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17088
	if (win) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17089
	    CPRINTF(("activateWindow %x\n",win));
4353
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4351
diff changeset
 17090
#if 0
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17091
	    ShowWindowAsync(win, SW_SHOW);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17092
#else
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17093
	    ShowWindow(win, SW_SHOW);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17094
#endif
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17095
	}
4792
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17096
    }
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17097
%}
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17098
!
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17099
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17100
activateWindow2:aWindowId
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17101
    "make a window active (so that it gets the focus).
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17102
     Paranoid implementation."
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17103
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17104
%{  /* NOCONTEXT */
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17105
    if (__isExternalAddress(aWindowId)) {
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17106
	HWND win = _HWNDVal(aWindowId);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17107
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17108
	if (win) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17109
	    DWORD activeThreadID, activeProcessID;
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17110
	    DWORD myThreadID;
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17111
	    HWND foregroundWindow = GetForegroundWindow();
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17112
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17113
	    if (foregroundWindow) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17114
		activeThreadID = GetWindowThreadProcessId(foregroundWindow, &activeProcessID);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17115
		myThreadID = GetCurrentThreadId();
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17116
		AttachThreadInput(activeThreadID, myThreadID, TRUE);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17117
	    }
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17118
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17119
	    // Do our stuff here ;-)
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17120
	    ShowWindow(win, SW_SHOW);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17121
	    SetForegroundWindow(win);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17122
	    SetFocus(win);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17123
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17124
	    if (foregroundWindow) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17125
		AttachThreadInput(activeThreadID, myThreadID, FALSE);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17126
	    }
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17127
	}
4792
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17128
    }
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17129
%}
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17130
!
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17131
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17132
activateWindow:aWindowId
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17133
    "make a window active (so that it gets the focus)"
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17134
5150
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17135
    "/ on some systems I seem to not get the window to be raised with focus.
4792
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17136
    "/ we might try activate2 there.
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17137
5150
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17138
    "/ self activateWindow1:aWindowId
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17139
    self activateWindow2:aWindowId
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 17140
!
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 17141
4490
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17142
animateWindow:aWindowId show:doShow animation:animationSymbolorNil time:timeInMillisOrNil
4491
c011e738596f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4490
diff changeset
 17143
    "make a window visible/invisible with animation effect.
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17144
     CAVEAT:
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17145
	This does not work yet correctly, as we do not handle WM_PRINT messages correctly."
4490
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17146
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17147
%{
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17148
    if (__isExternalAddress(aWindowId)) {
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17149
	HWND hWnd = _HWNDVal(aWindowId);
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17150
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17151
	if (hWnd) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17152
	    DWORD how = (doShow == true) ? AW_ACTIVATE : AW_HIDE;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17153
	    DWORD time = 0;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17154
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17155
	    CPRINTF(("mapWindowAnimated %x\n", hWnd));
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17156
	    if (animationSymbolorNil != nil) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17157
		if (__isSmallInteger(timeInMillisOrNil)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17158
		    time = __intVal(timeInMillisOrNil);
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17159
		}
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17160
		if (animationSymbolorNil == @symbol(SLIDE)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17161
		    how |= AW_SLIDE;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17162
		} else if (animationSymbolorNil == @symbol(BLEND)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17163
		    how |= AW_BLEND;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17164
		} else if (animationSymbolorNil == @symbol(CENTER)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17165
		    how |= AW_CENTER;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17166
		} else if (animationSymbolorNil == @symbol(HOR_POSITIVE)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17167
		    how |= AW_HOR_POSITIVE;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17168
		} else if (animationSymbolorNil == @symbol(HOR_NEGATIVE)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17169
		    how |= AW_HOR_NEGATIVE;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17170
		} else if (animationSymbolorNil == @symbol(VER_POSITIVE)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17171
		    how |= AW_VER_POSITIVE;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17172
		} else if (animationSymbolorNil == @symbol(VER_NEGATIVE)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17173
		    how |= AW_VER_NEGATIVE;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17174
		}
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17175
	    }
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17176
	    AnimateWindow(hWnd, time, how);
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17177
	}
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17178
	RETURN ( self );
4490
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17179
    }
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17180
%}
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17181
!
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17182
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17183
configureWindow:aWindowId sibling:siblingId stackMode:modeSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17184
    "configure stacking operation of aWindowId w.r.t siblingId"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17185
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17186
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17187
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17188
dropFilesWindow:aWindowId accept:doAccept
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17189
    "window accept Files from Shell"
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17190
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17191
%{  /*  */
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17192
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17193
    if (__isExternalAddress(aWindowId)) {
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17194
	HWND hWnd = _HWNDVal(aWindowId);
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17195
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17196
	if (hWnd) {
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17197
	    if (doAccept == true)
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17198
	    DragAcceptFiles(hWnd, (doAccept == true) ? TRUE : FALSE);
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17199
	}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17200
	RETURN ( self );
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17201
    }
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17202
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17203
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17204
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17205
findWindow:lpClassName windowName:lpWindowName
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 17206
    "If the function succeeds, the return value is a handle to the window that has the specified class name
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17207
     and window name. If the function fails, the return value is NULL."
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17208
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17209
    ((lpClassName notNil and:[lpClassName bitsPerCharacter > 8])
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17210
    or:[ (lpWindowName notNil and:[lpWindowName bitsPerCharacter > 8]) ]) ifTrue:[
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17211
	^ self
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17212
	    primFindWindowW:(lpClassName isNil
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17213
				    ifTrue:[nil]
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17214
				    ifFalse:[lpClassName asUnicode16String asAsciiZ])
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17215
	    windowName:(lpWindowName isNil
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17216
				    ifTrue:[nil]
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17217
				    ifFalse:[lpWindowName asUnicode16String asAsciiZ])
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17218
    ].
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17219
    ^ self primFindWindowA:lpClassName windowName:lpWindowName
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17220
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17221
    "
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17222
     |h|
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17223
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17224
     h := Screen current findWindow:'Shell_TrayWnd' windowName:''.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17225
     Screen current prim_getWindowRect:h.
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17226
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17227
     Display findWindow:nil windowName:'ST/X Launcher'
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17228
    "
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17229
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17230
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17231
getParentWindowIdOfWindowId:aChildWindowId
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17232
%{  /* NOCONTEXT */
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17233
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17234
    if (__isExternalAddress(aChildWindowId)) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17235
	HWND wChild = _HWNDVal(aChildWindowId);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17236
	HWND wParent;
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17237
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17238
	if (wChild) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17239
	    wParent = GetParent(wChild);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17240
	    if (wParent) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17241
		RETURN ( __MKEXTERNALADDRESS(wParent) );
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17242
	    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17243
	}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17244
    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17245
%}.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17246
    ^ nil
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17247
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17248
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17249
     |top v|
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17250
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17251
     top := View new.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17252
     v := View in:top.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17253
     top realize.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17254
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17255
     self assert:(Display getParentWindowIdOfWindowId:(v id)) = top id.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17256
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17257
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17258
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17259
getThreadIdOfWindowId:windowId
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17260
%{  /* NOCONTEXT */
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17261
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17262
    if (__isExternalAddress(windowId)) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17263
	HWND hwnd = _HWNDVal(windowId);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17264
	DWORD id;
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17265
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17266
	if (hwnd) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17267
	    id = GetWindowThreadProcessId(hwnd, &id);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17268
	    RETURN ( __MKEXTERNALADDRESS(id) );
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17269
	}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17270
    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17271
%}.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17272
    ^ nil
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17273
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17274
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17275
     |top|
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17276
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17277
     top := View new.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17278
     top realize.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17279
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17280
     self assert:(Display getThreadIdOfWindowId:(top id)) = OperatingSystem getProcessId.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17281
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17282
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17283
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17284
getWindowClassName:aWindowId
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17285
    "get a (possibly alien) window's class name"
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17286
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17287
    |buffer n|
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17288
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17289
    buffer := Unicode16String new:200.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17290
    n := self primGetWindowClassW:aWindowId into:buffer size:200.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17291
    n >= 0 ifTrue:[
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17292
	^ (buffer copyTo:n) asSingleByteStringIfPossible
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17293
    ].
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17294
    self primitiveFailed.
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17295
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17296
    "
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17297
     |h|
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17298
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17299
     h := Display findWindow:nil windowName:'ST/X Launcher'.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17300
     Display getWindowClassName:h.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17301
    "
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17302
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17303
    "
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17304
     |h|
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17305
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17306
     h := Display findWindow:nil windowName:'ST/XX Launcher'.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17307
     Display getWindowText:h.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17308
    "
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17309
!
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17310
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17311
getWindowIdFromThreadId:id
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17312
    |l|
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17313
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17314
    l := OrderedCollection new.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17315
    self primEnumWindowsInto:l.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17316
    l do:[:eachWindowId |
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17317
	(self getParentWindowIdOfWindowId:eachWindowId) isNil ifTrue:[
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17318
	    "/ a topView
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17319
	    (self getThreadIdOfWindowId:eachWindowId) = id ifTrue:[
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17320
		^ eachWindowId
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17321
	    ].
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17322
	]
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17323
    ].
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17324
    ^ nil
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17325
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17326
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17327
     Display getWindowIdFromThreadId:(OperatingSystem getProcessId)
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17328
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17329
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17330
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17331
getWindowRectangle:aWindowId
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17332
    "get a (possibly alien) window's screen rectangle"
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17333
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17334
    |bytes|
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17336
    (aWindowId isNil or:[aWindowId address == 0]) ifTrue:[^ self].
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17337
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17338
    bytes := ByteArray new:(ExternalBytes sizeofLong*4).
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17339
    self primGetWindowRect:aWindowId lpRect:bytes.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17340
    ^ Rectangle
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17341
	left:(bytes longAt:1)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17342
	top:(bytes longAt:5)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17343
	right:(bytes longAt:9)
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17344
	bottom:(bytes longAt:13)
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17345
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17346
    "
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17347
     |handle|
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17348
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17349
     handle := Display findWindow: nil windowName: 'ST/X Launcher'.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17350
     (handle isNil or:[handle address == 0]) ifTrue:[self halt.].
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17351
     Display getWindowRectangle:handle.
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17352
    "
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17353
!
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17354
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17355
getWindowText:aWindowId
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17356
    "get a (possibly alien) window's title text"
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17357
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17358
    |buffer n|
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17359
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17360
    buffer := Unicode16String new:200.
5334
da0ae55ea30f code cleanup
Claus Gittinger <cg@exept.de>
parents: 5333
diff changeset
 17361
    n := self primGetWindowTextW:aWindowId into:buffer size:200.
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17362
    n >= 0 ifTrue:[
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17363
	^ (buffer copyTo:n) asSingleByteStringIfPossible
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17364
    ].
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17365
    self primitiveFailed.
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17366
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17367
    "
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17368
     |h|
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17369
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17370
     h := Display findWindow:nil windowName:'ST/X Launcher'.
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17371
     Display getWindowText:h.
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17372
    "
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17373
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17374
    "
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17375
     |h|
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17376
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17377
     h := Display findWindow:nil windowName:'ST/XX Launcher'.
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17378
     Display getWindowText:h.
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17379
    "
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17380
!
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17381
4455
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17382
isValidWindowId:aWindowId
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17383
    "return true, if the given window ID is (still) valid.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17384
     Especially useful, if the passed windowID is
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17385
     an alien (external) windows id."
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17386
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17387
%{
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17388
    if (__isExternalAddress(aWindowId)) {
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17389
	HWND win = _HWNDVal(aWindowId);
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17390
	DWORD threadID, processID = 0;
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17391
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17392
	if (! IsWindow(win)) {
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17393
	    RETURN (false);
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17394
	}
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17395
	threadID = GetWindowThreadProcessId(win, &processID);
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17396
	if ((threadID==0) || (processID==0)) {
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17397
	    RETURN (false);
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17398
	}
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17399
	RETURN (true);
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17400
    }
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17401
%}.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17402
    self primitiveFailed.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17403
    ^ false
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17404
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17405
    "
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17406
     |v aWindowId ok|
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17407
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17408
     v := StandardSystemView new.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17409
     v label:'hello'.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17410
     v openAndWait.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17411
     aWindowId := v id.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17412
     ok := Display isValidWindowId:aWindowId.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17413
     Transcript showCR:'ok is: ' , ok printString.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17414
     Delay waitForSeconds:1.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17415
     v destroy.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17416
     Delay waitForSeconds:0.5.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17417
     ok := Display isValidWindowId:aWindowId.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17418
     Transcript showCR:'ok is: ' , ok printString.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17419
    "
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17420
!
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17421
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17422
lowerWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17423
    "bring a window to back"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17424
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17425
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17426
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17427
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17428
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17429
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17430
	if (win) {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 17431
	    CPRINTF(("lowerWindow %x\n",win));
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 17432
	    SetWindowPos(win, HWND_BOTTOM, 0, 0, 0, 0,
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 17433
			 SWP_NOSENDCHANGING |
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 17434
			 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17435
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17436
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17437
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17438
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17439
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17440
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17441
mapView:aView id:aWindowId iconified:aBoolean atX:x y:y width:w height:h minExtent:minExt maxExtent:maxExt
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 17442
    "make a window visible - either as icon or as a real view
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17443
     in addition, allow change of extend, position, minExtend and maxExtent.
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17444
     Needed for restart, to allow recreating a view as iconified,
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17445
     and to collaps/expand windows."
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17446
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17447
    |minW minH maxW maxH|
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17448
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17449
    minExt notNil ifTrue:[
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17450
	minW := minExt x.
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17451
	minH := minExt y.
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17452
    ].
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17453
    maxExt notNil ifTrue:[
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17454
	maxW := maxExt x.
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17455
	maxH := maxExt y.
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17456
    ].
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17457
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 17458
%{
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17459
    if (__isExternalAddress(aWindowId)) {
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17460
	HWND win = _HWNDVal(aWindowId);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17461
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17462
	if (win) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17463
	    int bw = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17464
	    int flag = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17465
	    int __left, __top, __width, __height;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17466
	    int winStyleBits;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17467
	    int winExStyleBits;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17468
	    localWindowInfo *lI;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17469
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17470
	    bw = GetWindow_bw(win);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17471
	    winStyleBits = GetWindowLong(win, GWL_STYLE);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17472
	    winExStyleBits = GetWindowLong(win, GWL_EXSTYLE);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17473
	    lI = GETLOCALWINDOWINFOPTR(win);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17474
	    if (! lI) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17475
		console_fprintf(stderr, "WinWorkstation [info]: oops - no localInfo in mapView\n");
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17476
		RETURN (self);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17477
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17478
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17479
	    if (__bothSmallInteger(x, y)) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17480
		__left = __intVal(x) + bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17481
		__top = __intVal(y) + bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17482
	    } else {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17483
		__left = __top = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17484
		flag |= SWP_NOMOVE;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17485
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17486
	    if (__bothSmallInteger(w, h)) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17487
		__width = __intVal(w) - bw - bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17488
		__height = __intVal(h) - bw - bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17489
	    } else {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17490
		__width = __height = 100;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17491
		flag |= SWP_NOSIZE;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17492
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17493
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17494
	    if (__bothSmallInteger(minW, minH)) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17495
		RECT rec;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17496
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17497
		rec.left = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17498
		rec.top = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17499
		rec.right = __intVal(minW);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17500
		rec.bottom = __intVal(minH);
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17501
#ifdef ADJUSTWINDOW
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17502
		AdjustWindowRectEx(&rec, winStyleBits, 0, winExStyleBits);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17503
#endif
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17504
		lI->minWidth = rec.right - rec.left;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17505
		lI->minHeight = rec.bottom - rec.top;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17506
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17507
	    if (__bothSmallInteger(maxW, maxH)) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17508
		RECT rec;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17509
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17510
		rec.left = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17511
		rec.top = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17512
		rec.right = __intVal(maxW);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17513
		rec.bottom = __intVal(maxH);
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17514
#ifdef ADJUSTWINDOW
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17515
		AdjustWindowRectEx(&rec, winStyleBits, 0, winExStyleBits);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17516
#endif
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17517
		lI->maxWidth = rec.right - rec.left;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17518
		lI->maxHeight = rec.bottom - rec.top;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17519
	    }
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17520
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17521
#ifdef ADJUSTWINDOW
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17522
	    if (flag != (SWP_NOMOVE | SWP_NOSIZE)) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17523
		RECT rec;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17524
		int __left0, __top0, __width0, __height0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17525
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17526
		__left0   = __left;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17527
		__top0    = __top;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17528
		__width0  = __width;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17529
		__height0 = __height;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17530
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17531
		rec.left = __left-2;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17532
		rec.top = __top-2;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17533
		rec.right = rec.left + __width;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17534
		rec.bottom = rec.top + __height;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17535
		AdjustWindowRectEx(&rec, winStyleBits, 0, winExStyleBits);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17536
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17537
		__left = rec.left;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17538
		__top = rec.top;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17539
		__width = rec.right - rec.left;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17540
		__height = rec.bottom - rec.top;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17541
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17542
		CPRINTF(("mapView %x %d/%d %d/%d -> %d/%d %d/%d\n",
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17543
			 win,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17544
			 __left0, __top0, __width0, __height0,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17545
			 __left, __top, __width, __height));
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17546
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17547
#else
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17548
	    CPRINTF(("mapView %x %d/%d %d/%d\n",
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17549
		     win,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17550
		     __left, __top, __width, __height));
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17551
#endif
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17552
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17553
	    flag |= SWP_NOACTIVATE | SWP_NOSENDCHANGING | SWP_NOZORDER | SWP_NOOWNERZORDER;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17554
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17555
	    if (aBoolean == true) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17556
		/* iconified */
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17557
//              SetWindowPos(win, (HWND)0,
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17558
//                           __left, __top, __width, __height,
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17559
//                           flag);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17560
//                ShowWindow(win, SW_SHOWMINIMIZED);
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17561
		ShowWindowAsync(win, SW_SHOWMINNOACTIVE);
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
 17562
/*
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17563
		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
 17564
*/
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17565
	    } else {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17566
		/* normal */
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17567
		SetWindowPos(win, (HWND)0,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17568
			     __left, __top, __width, __height,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17569
			     flag);
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
 17570
/*
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17571
		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
 17572
*/
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17573
		//ShowWindow(win, SW_RESTORE);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17574
		// ShowWindowAsync(win, SW_RESTORE);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17575
		ShowWindowAsync(win, SW_SHOWNOACTIVATE);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17576
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17577
	}
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17578
	RETURN ( self );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17579
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17580
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17581
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17582
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17583
mapWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17584
    "make a window visible"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17585
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17586
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17587
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17588
    if (__isExternalAddress(aWindowId)) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 17589
	HWND hWnd = _HWNDVal(aWindowId);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 17590
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 17591
	if (hWnd) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 17592
	    CPRINTF(("mapWindow %x\n", hWnd));
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 17593
	    if (GetParent(hWnd) == 0) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 17594
		ShowWindowAsync(hWnd, SW_SHOWNOACTIVATE);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 17595
	    } else {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 17596
		ShowWindowAsync(hWnd, SW_SHOWNORMAL);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 17597
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17598
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17599
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17600
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17601
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17602
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17603
4490
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17604
mapWindow:aWindowId animation:animationSymbolorNil time:timeInMillisOrNil
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17605
    "make a window visible with some animation effect"
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17606
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17607
    self animateWindow:aWindowId show:true animation:animationSymbolorNil time:timeInMillisOrNil
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17608
!
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17609
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17610
moveResizeWindow:aWindowId x:x y:y width:w height:h
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17611
    "move and resize a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17612
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17613
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17614
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17615
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17616
     && __bothSmallInteger(x, y)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17617
     && __bothSmallInteger(w, h)) {
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17618
	HWND win = _HWNDVal(aWindowId);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17619
	int bw = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17620
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17621
	if (win) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17622
	    bw = GetWindow_bw(win);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17623
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17624
	    rec.left = __intVal(x) + bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17625
	    rec.top = __intVal(y) + bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17626
	    rec.right = rec.left + __intVal(w) - bw - bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17627
	    rec.bottom = rec.top + __intVal(h) - bw - bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17628
	    if (GetParent(win) == 0) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17629
#ifdef ADJUSTWINDOW
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17630
		AdjustWindowRectEx(&rec,GetWindowLong(win,GWL_STYLE),0,GetWindowLong(win,GWL_EXSTYLE));
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17631
#endif
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17632
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17633
	    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,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17634
			 rec.right - rec.left, rec.bottom - rec.top));
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17635
	    SetWindowPos(win, (HWND)0,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17636
			 rec.left, rec.top,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17637
			 rec.right - rec.left, rec.bottom - rec.top,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17638
			 SWP_NOSENDCHANGING | SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOOWNERZORDER);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17639
	}
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17640
	RETURN ( self );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17641
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17642
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17643
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17644
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17645
moveWindow:aWindowId x:x y:y
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17646
    "move a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17647
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17648
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17649
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17650
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17651
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17652
     && __bothSmallInteger(x, y)) {
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17653
	HWND win = _HWNDVal(aWindowId);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17654
	int bw = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17655
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17656
	if (win) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17657
	    bw = GetWindow_bw(win);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17658
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17659
	    rec.left = __intVal(x) + bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17660
	    rec.top = __intVal(y) + bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17661
	    if (GetParent(win) == 0) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17662
		rec.right = rec.left + 10;  /* only needed to give adjust some valid numbers */
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17663
		rec.bottom = rec.top + 10;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17664
#ifdef ADJUSTWINDOW
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17665
		AdjustWindowRectEx(&rec, GetWindowLong(win,GWL_STYLE), 0, GetWindowLong(win,GWL_EXSTYLE));
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17666
#endif
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17667
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17668
	    CPRINTF(("move %x x:%d y:%d -> x:%d y:%d\n", win,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17669
			__intVal(x), __intVal(y), rec.left, rec.top));
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17670
	    SetWindowPos(win, (HWND)0,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17671
			 rec.left, rec.top,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17672
			 0, 0,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17673
			 SWP_NOSENDCHANGING | SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17674
	}
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17675
	RETURN ( self );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17676
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17677
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17678
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17679
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17680
primEnumChildWindowsOf:aWindowId into:handleList
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 17681
%{
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17682
    if (__isExternalAddress(aWindowId)) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17683
	HWND hwParent = _HWNDVal(aWindowId);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17684
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17685
	if ( EnumChildWindows( hwParent, EnumWindowsProc, (DWORD)&(handleList))) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17686
	    DPRINTF(("EnumChildWindows successful\n"));
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17687
	}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17688
    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17689
%}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17690
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17691
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 17692
primEnumWindowsInto:handleList
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 17693
%{
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 17694
    if ( EnumWindows( EnumWindowsProc, (DWORD)&(handleList))) {
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 17695
	DPRINTF(("EnumWindows successful\n"));
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 17696
    }
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 17697
%}
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 17698
!
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 17699
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17700
primEnumWindowsOf:threadId into:handleList
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 17701
%{
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17702
    if (__isSmallInteger(threadId)) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17703
	if ( EnumThreadWindows( __intVal(threadId), EnumWindowsProc, (DWORD)&(handleList))) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17704
	    DPRINTF(("EnumThreadWindows successful\n"));
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17705
	}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17706
    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17707
%}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17708
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17709
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17710
primFindWindowA:lpClassName windowName:lpWindowName
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17711
    "If the function succeeds, the return value is a handle to the window that has the
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17712
     specified class name and window name. If the function fails, the return value is NULL."
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17713
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17714
    <apicall: handle "FindWindowA" (lpstr lpstr) module: "user32.dll" >
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17715
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17716
    "
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17717
     self primFindWindow: nil windowName: 'WORK2 ST/X Launcher [FELIXM]'
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17718
    "
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17719
!
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17720
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17721
primFindWindowW:lpClassName windowName:lpWindowName
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17722
    "If the function succeeds, the return value is a handle to the window that has the specified
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17723
     class name and window name. If the function fails, the return value is NULL."
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17724
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17725
    <apicall: handle "FindWindowW" (lpstr lpstr) module: "user32.dll" >
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17726
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17727
    "
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17728
     self primFindWindow: nil windowName: 'WORK2 ST/X Launcher [FELIXM]' asAsciiZ
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 17729
    "
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 17730
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 17731
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17732
primGetWindowClassW:aWindowId into:buffer size:maxSize
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17733
    "get a window's class name"
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17734
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17735
    <apicall: int "GetClassNameW" (handle, pointer, int) module: "user32.dll" >
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17736
!
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17737
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17738
primGetWindowRect:aWindowId lpRect:lpRect
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17739
    "get a window's screen rectangle"
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17740
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17741
    <apicall: int "GetWindowRect" (handle, pointer) module: "user32.dll" >
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17742
!
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17743
5334
da0ae55ea30f code cleanup
Claus Gittinger <cg@exept.de>
parents: 5333
diff changeset
 17744
primGetWindowTextW:aWindowId into:buffer size:maxSize
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 17745
    "get a window's title text"
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 17746
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17747
    <apicall: int "GetWindowTextW" (handle, pointer, int) module: "user32.dll" >
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17748
!
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17749
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17750
primSendMessage:aWindowId message:message wParam:wParam lParam:lParam
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17751
    "Sends the specified message to a (possibly alien) window.
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17752
     The SendMessage function calls the window procedure for the specified window and
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17753
     does not return until the target's window procedure has processed the message."
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 17754
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 17755
    <apicall: bool "SendMessageA" (handle uint ulong ulong) module: "user32.dll" >
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 17756
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 17757
5027
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 17758
primSetForegroundWindow: aWindowId
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 17759
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 17760
    "
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 17761
    If the window was brought to the foreground, the return value is nonzero.
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 17762
    If the window was not brought to the foreground, the return value is zero.
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 17763
    "
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 17764
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 17765
    <apicall: bool "SetForegroundWindow" (handle) module: "user32.dll" >
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 17766
!
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 17767
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17768
primSetWindowIconId:wiconId maskId:wmaskId width:wiconWidth height:wiconHeight in:aWindowId
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 17769
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17770
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17771
    HBITMAP        xBitMap, maskBitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17772
    ICONINFO       iconInfo;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17773
    int            height, width;
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17774
    HICON          xIcon = (HICON)0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17775
    unsigned char  fastBits[10000];
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17776
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17777
    DPRINTF(("primSetWindowIconId\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17778
    if (__isExternalAddress(aWindowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17779
     && __isExternalAddress(wiconId)
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17780
     && __bothSmallInteger(wiconWidth, wiconHeight)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17781
	HWND win = _HWNDVal(aWindowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17782
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17783
	xBitMap = _HBITMAPVAL( wiconId );
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17784
	if ( xBitMap != 0 ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17785
	    BITMAP bm;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17786
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17787
	    if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17788
		BYTE *ep;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17789
		int privateMask = 0;
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
 17790
		unsigned char  *allocatedBits = 0;
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17791
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17792
		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
 17793
		height = __intVal( wiconHeight );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17794
		width  = __intVal( wiconWidth  );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17795
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17796
		if ( __isExternalAddress(wmaskId) ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17797
		    maskBitmap = _HBITMAPVAL( wmaskId );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17798
		} else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17799
		    if (wmaskId != nil) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17800
			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
 17801
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17802
		    maskBitmap = 0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17803
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17804
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17805
		/*
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17806
		 * if there is no mask, generate one
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17807
		 */
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17808
		if (maskBitmap == 0) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17809
		    int nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17810
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17811
		    nBytes = ( width + 31 ) / 8;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17812
		    nBytes = height * nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17813
		    if (nBytes < sizeof(fastBits)) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17814
			ep = fastBits;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17815
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17816
			ep = allocatedBits = (unsigned char *) malloc(nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17817
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17818
		    if ( ep == 0 ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17819
			PRINTF(( "WinWorkstat [warning]: malloc failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17820
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17821
			memset(ep, 0, nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17822
			maskBitmap = CreateBitmap(width, height, 1, 1, ep );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17823
			if ( maskBitmap == NULL ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17824
			    PRINTF(( "WinWorkstat [warning]: mask CREATION failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17825
			} else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17826
			    privateMask = 1;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17827
			}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17828
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17829
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17830
		if ( maskBitmap != NULL ) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17831
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17832
		    iconInfo.fIcon = TRUE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17833
		    iconInfo.hbmMask  =maskBitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17834
		    iconInfo.hbmColor = xBitMap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17835
		    xIcon = CreateIconIndirect( &iconInfo );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17836
		    DPRINTF(( "ICON CREATED!!!\n" ));
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17837
		    if (privateMask) {
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 17838
			_DeleteObject( maskBitmap, __LINE__ );
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 17839
		    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17840
		} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17841
		    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
 17842
		}
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17843
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17844
		if (allocatedBits) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17845
		    free(allocatedBits);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17846
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17847
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17848
	} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17849
	    DPRINTF(("WinWorkstat [warning]: xBitMap is zero \n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17850
	}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17851
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17852
	if (xIcon) {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
 17853
#ifndef TOPWINDOWCLASS
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17854
	    HICON oldIcon = (HICON)0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17855
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17856
	    oldIcon = (HICON) GetClassLong(win, GCL_HICON);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17857
	    SetClassLong(win, GCL_HICON, (DWORD)xIcon);
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 17858
/* It has to be checked whether this can be deleted!!!!! */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17859
	    if ( oldIcon ) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17860
		if (DestroyIcon( oldIcon )) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17861
		    DPRINTF(( "Old icon deleted\n" ));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17862
		} else {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 17863
		    console_fprintf(stderr, "failed to delete old icon\n");
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17864
		}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17865
	    }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
 17866
#else
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17867
	    SendMessage(win, WM_SETICON,ICON_SMALL, (LPARAM)xIcon);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17868
	    SendMessage(win, WM_SETICON,ICON_BIG, (LPARAM)xIcon);
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
 17869
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17870
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17871
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17872
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17873
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17874
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17875
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17876
raiseWindow:aWindowId
4523
df48174867cc Do not collapse a maximized window on #activate:
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
 17877
    "bring a window to front - but there may be some windows marked as 'TOPMOST'
df48174867cc Do not collapse a maximized window on #activate:
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
 17878
     that are still in front of our window (e.g. cmd.exe apparently marks itself
df48174867cc Do not collapse a maximized window on #activate:
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
 17879
     as topmost, when it gets the focus)"
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17880
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17881
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17882
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17883
    if (__isExternalAddress(aWindowId)) {
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17884
	HWND hWnd = _HWNDVal(aWindowId);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17885
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17886
	if (hWnd) {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17887
	    CPRINTF(("raiseWindow %x\n",hWnd));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17888
	    SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17889
			 /* SWP_NOOWNERZORDER |*/
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17890
			SWP_NOSENDCHANGING | SWP_NOACTIVATE |
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17891
			SWP_NOMOVE | SWP_NOSIZE);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17892
	}
5150
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17893
    }
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17894
%}
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17895
!
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17896
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17897
raiseWindowToTop:aWindowId
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17898
    "bring a window to the very front - above all others (even above non-st/x windows).
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17899
     Q: is this a windows-specific thing ?"
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17900
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17901
%{  /* NOCONTEXT */
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17902
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17903
    if (__isExternalAddress(aWindowId)) {
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17904
	HWND hWnd = _HWNDVal(aWindowId);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17905
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17906
	if (hWnd) {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17907
	    CPRINTF(("raiseWindow %x\n",hWnd));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17908
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17909
	    SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17910
			 /* SWP_NOOWNERZORDER |*/
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17911
			SWP_NOSENDCHANGING | SWP_NOACTIVATE |
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17912
			SWP_NOMOVE | SWP_NOSIZE);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17913
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17914
	    SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17915
			 /* SWP_NOOWNERZORDER |*/
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17916
			SWP_NOSENDCHANGING | SWP_NOACTIVATE |
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17917
			SWP_NOMOVE | SWP_NOSIZE);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17918
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17919
	    SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17920
			/* SWP_NOOWNERZORDER | */
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17921
			/* SWP_NOSENDCHANGING | SWP_NOACTIVATE | */
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17922
			SWP_NOMOVE | SWP_NOSIZE);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17923
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17924
	    SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17925
			/* SWP_NOOWNERZORDER | */
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17926
			/* SWP_NOSENDCHANGING | SWP_NOACTIVATE | */
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17927
			SWP_NOMOVE | SWP_NOSIZE);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17928
	}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17929
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17930
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17931
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17932
4441
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 17933
reparentWindow:windowId to:newParentWindowId
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 17934
    "change a windows parent (an optional interface)"
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 17935
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 17936
%{
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 17937
    if (__isExternalAddress(windowId)
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 17938
     && __isExternalAddress(newParentWindowId)) {
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 17939
	HWND hWnd = _HWNDVal(windowId);
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 17940
	HWND hWndNewParent = _HWNDVal(newParentWindowId);
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 17941
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 17942
	SetParent(hWnd, hWndNewParent);
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 17943
	RETURN ( true );
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 17944
    }
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 17945
%}.
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 17946
    self primitiveFailed
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 17947
!
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 17948
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17949
resizeWindow:aWindowId width:w height:h
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17950
    "resize a window"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17951
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17952
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17953
    RECT rec;
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17954
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17955
    if (__isExternalAddress(aWindowId)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17956
     && __bothSmallInteger(w, h)) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17957
	HWND hWnd = _HWNDVal(aWindowId);
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 17958
	int bw;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17959
2593
1d2dad16f32c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2554
diff changeset
 17960
	if (hWnd) {
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 17961
	    bw = GetWindow_bw(hWnd);
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 17962
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17963
	    rec.left = 0;  /* only needed to have a valid origin in adjust */
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17964
	    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
 17965
	    rec.right = __intVal(w) - bw - bw;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 17966
	    rec.bottom = __intVal(h) - bw - bw;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17967
#ifdef ADJUSTWINDOW
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17968
	    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
 17969
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17970
	    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
 17971
	    SetWindowPos(hWnd, (HWND)0,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17972
			 0, 0,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17973
			 rec.right - rec.left, rec.bottom - rec.top,
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17974
			 SWP_NOSENDCHANGING | SWP_NOACTIVATE |
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 17975
			 SWP_NOMOVE | SWP_NOZORDER | SWP_NOOWNERZORDER);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17976
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17977
	RETURN ( self );
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17978
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17979
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17980
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17981
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 17982
sendButtonMessageType:messageType at:aPoint toWindowId:aWindowId
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 17983
    "send a button message to a window by id (handle)"
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 17984
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 17985
    |wParam lParam result|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 17986
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 17987
    (aWindowId isNil or:[aWindowId address == 0]) ifTrue:[^ self].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 17988
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 17989
    wParam := 0.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 17990
    lParam := (aPoint x) + (aPoint y bitShift:16).
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 17991
    result := self primSendMessage:aWindowId message:messageType wParam:wParam lParam:lParam.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 17992
    ^ result
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 17993
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 17994
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 17995
     |v b externalAddress handle|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 17996
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 17997
     v := StandardSystemView new.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 17998
     b := Button in:v.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 17999
     b label:'ok'; origin:10@10 corner:100@30; action:[Transcript showCR:'ok'].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18000
     v openAndWait.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18001
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18002
     handle := b id.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18003
     (handle isNil or:[handle address == 0]) ifTrue:[self halt.].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18004
     externalAddress := handle asExternalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18005
     Display sendButtonPress:1 at:1@1 toWindowId: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18006
     Display sendButtonRelease:1 at:10@10 toWindowId: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18007
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18008
!
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18009
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18010
sendButtonPress:button at:aPoint toWindowId:aWindowId
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18011
    "send a button press message to a window by id (handle)"
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18012
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18013
    |messageType|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18014
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18015
    (button between:1 and:3) ifFalse:[self error].
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18016
    messageType := #(   16r0201 "WM_LBUTTONDOWN"
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18017
			16r0207 "WM_MBUTTONDOWN"
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18018
			16r0204 "WM_RBUTTONDOWN"  ) at:button.
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18019
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18020
    self sendButtonMessageType:messageType at:aPoint toWindowId:aWindowId
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18021
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18022
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18023
     |v b externalAddress handle|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18024
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18025
     v := StandardSystemView new.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18026
     b := Button in:v.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18027
     b label:'ok'; origin:10@10 corner:100@30; action:[Transcript showCR:'ok'].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18028
     v openAndWait.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18029
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18030
     handle := b id.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18031
     (handle isNil or:[handle address == 0]) ifTrue:[self halt.].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18032
     externalAddress := handle asExternalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18033
     Display sendButtonPress:1 at:1@1 toWindowId: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18034
     Display sendButtonRelease:1 at:10@10 toWindowId: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18035
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18036
!
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18037
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18038
sendButtonRelease:button at:aPoint toWindowId:aWindowId
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18039
    "send a button release message to a window by id (handle)"
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18040
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18041
    |messageType|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18042
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18043
    (button between:1 and:3) ifFalse:[self error].
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18044
    messageType := #(   16r0202 "WM_LBUTTONUP"
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18045
			16r0208 "WM_MBUTTONUP"
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18046
			16r0205 "WM_RBUTTONUP"  ) at:button.
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18047
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18048
    self sendButtonMessageType:messageType at:aPoint toWindowId:aWindowId
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18049
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18050
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18051
     |v b externalAddress handle|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18052
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18053
     v := StandardSystemView new.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18054
     b := Button in:v.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18055
     b label:'ok'; origin:10@10 corner:100@30; action:[Transcript showCR:'ok'].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18056
     v openAndWait.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18057
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18058
     handle := b id.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18059
     (handle isNil or:[handle address == 0]) ifTrue:[self halt.].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18060
     externalAddress := handle asExternalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18061
     Display sendButtonPress:1 at:1@1 toWindowId: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18062
     Display sendButtonRelease:1 at:10@10 toWindowId: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18063
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18064
!
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18065
5024
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18066
sendCopyData: aByteArray toWindowId: aWindowId
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18067
    "send copy-paste data to a window by id (handle)"
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18068
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18069
    |externalBytes messageType wParam lParam copyDataStruct result|
5024
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18070
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18071
    (aWindowId isNil or:[aWindowId address == 0]) ifTrue:[^ self].
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18072
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18073
    messageType := 74 "WM_COPYDATA".
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18074
    wParam := 0.
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18075
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18076
    copyDataStruct := CopyDataStructStructure new.
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18077
    copyDataStruct cbData:aByteArray size.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18078
    externalBytes := ExternalBytes from:aByteArray.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18079
    copyDataStruct lpData:externalBytes address.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18080
    lParam := ExternalBytes from:copyDataStruct.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18081
    result := self primSendMessage:aWindowId message:messageType wParam:wParam lParam:lParam address.
5024
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18082
    externalBytes free.
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18083
    lParam free.
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18084
    ^ result
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18085
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18086
    "
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18087
     |string bytes externalAddress handle|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18088
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18089
     string := 'c:\pipo.net' , 0 asCharacter asString.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18090
     bytes := string asByteArray.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18091
     handle := Display primFindWindow: nil windowName: 'ST/X Launcher [FELIXM]' asAsciiZ.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18092
     (handle isNil or:[handle address == 0]) ifTrue:[self halt.].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18093
     externalAddress := handle asExternalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18094
     Display setForegroundWindow: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18095
     Display sendCopyData: bytes toWindowId: externalAddress.
5024
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18096
    "
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18097
!
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18098
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18099
sendCopyDataString: aString toWindowId: aWindowId
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18100
    "send a string as copy-paste data to a window by id (handle)"
5024
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18101
5025
56bac82aef63 fix #sendCopyDataString: toWindowId:
fm
parents: 5024
diff changeset
 18102
    |aByteArray nullTerminatedString |
56bac82aef63 fix #sendCopyDataString: toWindowId:
fm
parents: 5024
diff changeset
 18103
56bac82aef63 fix #sendCopyDataString: toWindowId:
fm
parents: 5024
diff changeset
 18104
    nullTerminatedString := aString , 0 asCharacter asString.
56bac82aef63 fix #sendCopyDataString: toWindowId:
fm
parents: 5024
diff changeset
 18105
    aByteArray := nullTerminatedString asByteArray.
5024
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18106
    self sendCopyData: aByteArray toWindowId: aWindowId
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18107
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18108
    "
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18109
     |string externalAddress handle|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18110
     string := 'c:\pipo.net' , 0 asCharacter asString.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18111
     handle := Display primFindWindow: nil windowName: 'WORK6 ST/X Launcher [FELIXM]' asAsciiZ.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18112
     (handle isNil or:[handle address == 0]) ifTrue:[self halt.].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18113
     externalAddress := handle asExternalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18114
     Display setForegroundWindow: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18115
     Display sendCopyDataString: string toWindowId: externalAddress.
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18116
    "
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18117
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18118
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18119
setBackingStore:how in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18120
    "turn on/off backing-store for a window"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18121
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18122
    "/ 'WinWorkstation [info]: setBackingStore:in: not yet implemented' infoPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18123
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18124
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18125
setBitGravity:how in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18126
    "set bit gravity for a window"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18127
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18128
    "/ 'WinWorkstation [info]: setBitGravity:in: not yet implemented' infoPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18129
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18130
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18131
setCursor:aCursorId in:aWindowId
5515
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18132
    "define a cursor for a window"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18133
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18134
%{  /* NOCONTEXT */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18135
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18136
    HCURSOR newCursor;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18137
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18138
    if (ISCONNECTED
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18139
     && __isExternalAddress(aWindowId)
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18140
     && __isExternalAddress(aCursorId)) {
5515
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18141
        HWND win = _HWNDVal(aWindowId);
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18142
        POINT p;
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18143
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18144
        SetWindow_Cursor(win, _HCURSORVal(aCursorId));
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18145
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18146
        /*
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18147
         * The window's cursor has been set. When the mouse moves into
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18148
         * the window, the new cursor will be shown when the WM_SETCURSOR event is handled.
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18149
         * If the window contains the mouse pointer, no WM_SETCURSOR event is generated,
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18150
         * so we have to set the cursor ourself.
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18151
         */
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18152
        GetCursorPos(&p);
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18153
        if (WindowFromPoint(p) == win) {
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18154
#if defined(SET_CURSOR_IN_WINTHREAD)
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18155
            PostMessage(win, WM_THREAD_SETCURSOR, 0, (INT)_HCURSORVal(aCursorId));
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18156
#else
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18157
            SetCursor(_HCURSORVal(aCursorId));
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18158
#endif
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18159
        }
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18160
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18161
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18162
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18163
4439
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18164
setForegroundWindow2:aWindowId
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18165
    "make a window the foreground window"
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18166
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18167
%{  /* NOCONTEXT */
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18168
    if (__isExternalAddress(aWindowId)) {
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18169
	HWND win = _HWNDVal(aWindowId);
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18170
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18171
	if (win) {
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18172
	    ShowWindow(win, SW_SHOW);
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18173
	    SetForegroundWindow(win);
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18174
	    BringWindowToTop(win);
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18175
	}
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18176
	RETURN ( self );
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18177
    }
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18178
%}
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18179
!
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18180
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18181
setForegroundWindow:aWindowId
4523
df48174867cc Do not collapse a maximized window on #activate:
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
 18182
    "make a window the foreground window.
df48174867cc Do not collapse a maximized window on #activate:
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
 18183
     Under Win 98/Me/XP/2000 the window is not raised/activated, if a window from
df48174867cc Do not collapse a maximized window on #activate:
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
 18184
     a different process is currently active - in this case the title bar/icon is flashed.
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 18185
     this also raises the priority of the sending thread slightly"
4439
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18186
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18187
%{  /* NOCONTEXT */
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18188
    if (__isExternalAddress(aWindowId)) {
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 18189
	HWND win = _HWNDVal(aWindowId);
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 18190
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 18191
	if (win) {
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 18192
	    CPRINTF(("setForegroundWindow %x\n",win));
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 18193
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 18194
	    SetForegroundWindow(win);
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 18195
	}
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 18196
	RETURN ( self );
4439
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18197
    }
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18198
%}
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18199
!
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18200
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18201
setIconName:aString in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18202
    "define a windows iconname"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18203
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18204
%{  /* NOCONTEXT */
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 18205
#if 0
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18206
    if (__isExternalAddress(aWindowId)
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 18207
     && (__isStringLike(aString))) {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18208
	HWND win = _HWNDVal(aWindowId);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18209
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18210
	SetWindowText(win, __stringVal(aString));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18211
	RETURN (self);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18212
    }
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 18213
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18214
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18215
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18216
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18217
setParentWindowIdOf:aChildWindowId to:newParentWindowId
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18218
%{  /* NOCONTEXT */
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18219
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18220
    if (__isExternalAddress(aChildWindowId)
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18221
     && __isExternalAddress(newParentWindowId)) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18222
	HWND wChild = _HWNDVal(aChildWindowId);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18223
	HWND wNewParent = _HWNDVal(newParentWindowId);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18224
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18225
	if (wChild && wNewParent) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18226
	    SetParent(wChild, wNewParent);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18227
	}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18228
    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18229
%}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18230
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18231
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18232
setSaveUnder:yesOrNo in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18233
    "turn on/off save-under for a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18234
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18235
%{  /* NOCONTEXT */
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18236
    if (yesOrNo != false) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18237
	DPRINTF(("WinWorkstation [info]: setSaveUnder:in: not (yet) implemented\n"));
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18238
    }
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18239
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18240
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18241
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18242
setTransient:aWindowId for:aMainWindowId
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18243
    "set aWindowId to be a transient of aMainWindow.
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18244
     This will make the transient window to be iconified/deiconified
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18245
     together with the mainWindow.
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18246
     Typically, this is set for modal dialogs."
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18247
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18248
%{  /* NOCONTEXT */
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18249
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18250
#ifdef NOT_YET_SUPPORTED
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18251
    if (__isExternalAddress(aWindowId)) {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18252
	HWND w;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18253
	HWND cw = _HWNDVal(aWindowId);
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18254
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18255
	if ((aMainWindowId == nil) || (aMainWindowId == __MKSMALLINT(0))) {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18256
	    w = (HWND) 0;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18257
	} else {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18258
	    if (__isExternalAddress(aMainWindowId)) {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18259
		w = _HWNDVal(aMainWindowId);
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18260
	    } else {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18261
		goto getOutOfHere;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18262
	    }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18263
	}
2417
1e40a40e56e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2416
diff changeset
 18264
	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
 18265
	//SetParent(cw, w);
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18266
	RETURN ( self );
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18267
    }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18268
 getOutOfHere: ;
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18269
#else
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18270
    RETURN (self);
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18271
#endif
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18272
%}.
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18273
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18274
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18275
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18276
setWindowBackground:aColorIndex in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18277
    "set the windows background color. This is the color with which
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18278
     the view is filled whenever exposed. Do not confuse this with
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18279
     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
 18280
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18281
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18282
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18283
    if (__isExternalAddress(aWindowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18284
     && (__isSmallInteger(aColorIndex))) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18285
	HWND hWnd = _HWNDVal(aWindowId);
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
 18286
	int clr;
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18287
	HBRUSH oldBrush;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18288
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 18289
	oldBrush = GetWindow_viewBgBrush(hWnd);
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 18290
	if (oldBrush) {
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18291
	    SetWindow_viewBgBrush(hWnd, 0);
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18292
	    _DeleteBrushIfNotInCache(oldBrush, __LINE__);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18293
	}
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
 18294
	clr = st2RGB(__intVal(aColorIndex), 0);
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
 18295
	SetWindow_viewBgColor(hWnd, clr);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18296
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18297
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18298
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18299
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18300
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18301
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18302
setWindowBackgroundPixmap:aPixmapId in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18303
    "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
 18304
     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
 18305
     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
 18306
     with opaque drawing.
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18307
     NOTICE: due to the limitations of WIN95,
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18308
	     background pixmaps which are not 8x8 pixels in size,
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18309
	     are handled by smalltalk code in the WIN95 version."
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18310
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18311
%{
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18312
    if (__isExternalAddress(aWindowId)) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18313
	HWND hWnd = _HWNDVal(aWindowId);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18314
	HBITMAP pixmap;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18315
	HBRUSH oldBrush, newBrush;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18316
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18317
	if (__isExternalAddress(aPixmapId))
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18318
	    pixmap = _HBITMAPVAL(aPixmapId);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18319
	else
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18320
	    pixmap = 0;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18321
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 18322
	oldBrush = GetWindow_viewBgBrush(hWnd);
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 18323
	if (oldBrush) {
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18324
	    SetWindow_viewBgBrush(hWnd, 0);
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18325
	    _DeleteBrushIfNotInCache(oldBrush, __LINE__);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18326
	}
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18327
	if (pixmap) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18328
	    newBrush = CreatePatternBrush(pixmap);
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 18329
	    SetWindow_viewBgBrush(hWnd, newBrush);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18330
/*
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18331
 *            SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18332
 */
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18333
	}
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18334
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18335
	RETURN (self);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18336
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18337
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18338
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18339
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18340
setWindowBorderColor:aColorIndex in:aWindowId
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18341
    "set the windows border color.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18342
     NOTICE: borders are not supported by the win32 version."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18343
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18344
%{  /* NOCONTEXT */
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18345
    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
 18346
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18347
    if (__isExternalAddress(aWindowId)
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18348
     && __isSmallInteger(aColorIndex)) {
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18349
	HWND win = _HWNDVal(aWindowId);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18350
	int clr;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18351
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18352
	if (GetParent(win) != 0) {
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18353
	    clr = st2RGB(__intVal(aColorIndex), 0);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18354
	    SetWindow_bdColor(win, clr);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18355
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18356
	    {
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18357
		/*
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18358
		 * 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
 18359
		 * border colors ... (see UIPainter code)
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18360
		 */
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18361
		RECT rect;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18362
		HRGN rgn;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18363
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18364
		GetWindowRect(win, &rect);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18365
		rgn = CreateRectRgn(rect.left, rect.top, rect.right, rect.bottom);
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 18366
		DefWindowProcW(win, WM_NCPAINT, (WPARAM)rgn, 0);
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18367
		_DeleteObject(rgn, __LINE__);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18368
	    }
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18369
	}
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18370
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18371
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18372
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18373
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18374
setWindowBorderPixmap:aPixmapId in:aWindowId
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18375
    "set the windows border pattern.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18376
     NOTICE: border pixmaps are not supported by the win32 version."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18377
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18378
%{  /* NOCONTEXT */
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18379
    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
 18380
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18381
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18382
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18383
setWindowBorderWidth:aNumber in:aWindowId
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18384
    "set the windows border width.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18385
     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
 18386
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18387
%{  /* NOCONTEXT */
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18388
    int bw = (aNumber == __MKSMALLINT(0)) ? 0 : 1;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18389
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18390
    if (__isExternalAddress(aWindowId)) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18391
	HWND win = _HWNDVal(aWindowId);
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18392
	int gwl;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18393
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18394
	gwl = GetWindowLong(win, GWL_STYLE);
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18395
	if (gwl & WS_CHILD) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18396
	    SetWindow_bw(win, bw);
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18397
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18398
	    if (bw) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18399
		gwl |= WS_BORDER;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18400
	    } else {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18401
		gwl &= ~WS_BORDER;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18402
	    }
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18403
	    SetWindowLong(win, GWL_STYLE, gwl);
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18404
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18405
	    /*
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18406
	     * 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
 18407
	     * border colors ... (see UIPainter code)
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18408
	     */
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 18409
#if 0
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18410
	    PostMessage(win, WM_NCPAINT, 0, 0);
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 18411
#endif
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18412
	    {
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18413
		RECT rect;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18414
		HRGN rgn;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18415
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18416
		GetWindowRect(win, &rect);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18417
		rgn = CreateRectRgn(rect.left, rect.top, rect.right, rect.bottom);
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 18418
		DefWindowProcW(win, WM_NCPAINT, (WPARAM)rgn, 0);
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18419
		_DeleteObject(rgn, __LINE__);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18420
	    }
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18421
	}
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18422
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18423
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18424
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18425
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18426
setWindowClass:wClass name:wName in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18427
    "define class and name of a window.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18428
     This may be used by the window manager to
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18429
     select client specific resources."
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 18430
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18431
%{  /* NOCONTEXT */
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18432
    DPRINTF(("WinWorkstation [info]: setWindowClass:name:in: not (yet) implemented\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18433
%}.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18434
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18435
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18436
setWindowGravity:how in:aWindowId
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18437
    "set the window gravity - this makes the view to move
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18438
     automatically and can avoid redraws (if used properly)"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18439
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18440
%{  /* NOCONTEXT */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18441
    int gr = GRAVITY_NONE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18442
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18443
    if (__isExternalAddress(aWindowId)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18444
	HWND hWnd = _HWNDVal(aWindowId);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18445
	localWindowInfo *lI;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18446
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18447
	if (how == @symbol(South)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18448
	    gr = GRAVITY_S;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18449
	} else if (how == @symbol(SouthWest)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18450
	    gr = GRAVITY_SW;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18451
	} else if (how == @symbol(SouthEast)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18452
	    gr = GRAVITY_SE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18453
	} else if (how == @symbol(North)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18454
	    gr = GRAVITY_N;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18455
	} else if (how == @symbol(NorthWest)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18456
	    gr = GRAVITY_NW;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18457
	} else if (how == @symbol(NorthEast)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18458
	    gr = GRAVITY_NE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18459
	} else if (how == @symbol(East)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18460
	    gr = GRAVITY_E;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18461
	} else if (how == @symbol(West)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18462
	    gr = GRAVITY_W;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18463
	}
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 18464
	lI = GETLOCALWINDOWINFOPTR(hWnd);
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 18465
	if (lI) {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18466
	    lI->viewGravity = gr;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18467
	}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18468
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18469
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18470
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18471
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18472
setWindowIcon:aForm mask:aMaskForm in:aWindowId
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18473
    "set a windows icon & iconMask"
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18474
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18475
    |wiconId wmaskId wiconHeight wiconWidth|
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18476
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18477
    aForm notNil ifTrue:[
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18478
	wiconId := aForm id.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18479
	wiconHeight := aForm height.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18480
	wiconWidth  := aForm width.
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18481
	aMaskForm notNil ifTrue:[
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18482
	    wmaskId := aMaskForm id
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18483
	].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18484
	self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18485
	    primSetWindowIconId:wiconId
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18486
	    maskId:wmaskId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18487
	    width:wiconWidth
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18488
	    height:wiconHeight
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18489
	    in:aWindowId
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18490
    ].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18491
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18492
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18493
setWindowIconWindow:aView in:aWindowId
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18494
    "define a window to be used as icon.
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18495
     This is not supported with Windows (is it possible at all ?)."
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18496
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18497
    'WinWorkstation [info]: setWindowIconWindow:in: not implemented' infoPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18498
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18499
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18500
setWindowMinExtent:minExt maxExtent:maxExt in:aWindowId
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18501
    "set a windows minimum & max extents.
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18502
     nil arguments are ignored."
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18503
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18504
    |minW minH maxW maxH|
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18505
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18506
    minExt notNil ifTrue:[
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18507
	minW := minExt x.
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18508
	minH := minExt y.
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18509
    ].
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18510
    maxExt notNil ifTrue:[
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18511
	maxW := maxExt x.
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18512
	maxH := maxExt y.
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18513
    ].
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18514
%{
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18515
    if (__isExternalAddress(aWindowId)) {
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18516
	HWND win = _HWNDVal(aWindowId);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18517
	RECT rec;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18518
	int winStyleBits;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18519
	int winExStyleBits;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18520
	localWindowInfo *lI;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18521
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18522
	if (win) {
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18523
	    winStyleBits = GetWindowLong(win, GWL_STYLE);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18524
	    winExStyleBits = GetWindowLong(win, GWL_EXSTYLE);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18525
	    lI = GETLOCALWINDOWINFOPTR(win);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18526
	    if (! lI) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 18527
		console_fprintf(stderr, "WinWorkstation [info]: oops - no localInfo in setMinMaxExt\n");
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18528
		RETURN (self);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18529
	    }
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18530
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18531
	    if (__bothSmallInteger(minW, minH)) {
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18532
		RECT rec;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18533
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18534
		rec.left = 0;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18535
		rec.top = 0;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18536
		rec.right = __intVal(minW);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18537
		rec.bottom = __intVal(minH);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18538
#ifdef ADJUSTWINDOW
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18539
		AdjustWindowRectEx(&rec, winStyleBits, 0, winExStyleBits);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18540
#endif
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18541
		lI->minWidth = rec.right - rec.left;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18542
		lI->minHeight = rec.bottom - rec.top;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18543
	    }
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18544
	    if (__bothSmallInteger(maxW, maxH)) {
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18545
		RECT rec;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18546
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18547
		rec.left = 0;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18548
		rec.top = 0;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18549
		rec.right = __intVal(maxW);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18550
		rec.bottom = __intVal(maxH);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18551
#ifdef ADJUSTWINDOW
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18552
		AdjustWindowRectEx(&rec, winStyleBits, 0, winExStyleBits);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18553
#endif
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18554
		lI->maxWidth = rec.right - rec.left;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18555
		lI->maxHeight = rec.bottom - rec.top;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18556
	    }
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18557
	}
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18558
    }
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18559
%}
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18560
!
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 18561
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18562
setWindowName:aString in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18563
    "define a windows name"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18564
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18565
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18566
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18567
    if (__isExternalAddress(aWindowId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18568
	HWND win = _HWNDVal(aWindowId);
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18569
	wchar_t nameBuffer[ MAX_LABEL_SIZE ];
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18570
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 18571
	if (__isStringLike(aString)) {
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18572
	    ch2wch((char *)__stringVal(aString), nameBuffer, MAX_LABEL_SIZE);
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18573
	    SetWindowTextW(win, nameBuffer);
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18574
	    RETURN (self);
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18575
	}
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18576
	if (__isUnicode16String(aString)) {
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18577
	    int l = __unicode16StringSize(aString);
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18578
	    if (l >= MAX_LABEL_SIZE) l = MAX_LABEL_SIZE-1;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18579
	    memmove(nameBuffer, __unicode16StringVal(aString), l*sizeof(wchar_t));
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18580
	    nameBuffer[ l ] = 0;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18581
	    SetWindowTextW(win, nameBuffer);
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18582
	    RETURN (self);
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18583
	}
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18584
    }
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18585
%}
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18586
    "
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18587
     (StandardSystemView new label:'äöü') open
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 18588
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18589
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18590
2755
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18591
setWindowShapeEllipticalX:x Y:y width:w height:h in:aWindowId
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18592
    "set the windows shape to an elliptical region"
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18593
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18594
%{
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18595
    if (__isExternalAddress(aWindowId)
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18596
     && __bothSmallInteger(x, y)
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18597
     && __bothSmallInteger(w, h)) {
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18598
	HWND win = _HWNDVal(aWindowId);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18599
	int left = __intVal(x);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18600
	int top = __intVal(y);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18601
	int right = left + __intVal(w);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18602
	int bottom = top + __intVal(h);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18603
	HRGN rgn;
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18604
	HDC winDC;
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18605
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18606
	rgn = CreateEllipticRgn(left, top, right, bottom);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18607
	if (rgn) {
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18608
	    winDC = GetDCEx(win, 0, DCX_WINDOW);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18609
	    if (winDC) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 18610
#ifdef GDIFLUSH_WHEN_CHANGING_CLIP
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 18611
		GdiFlush();
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 18612
#endif
2755
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18613
		if (SelectClipRgn(winDC, rgn) == ERROR ) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 18614
		    console_fprintf(stderr, "select clipping region failed\n");
2755
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18615
		}
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18616
		ReleaseDC(win, winDC);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18617
	    }
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18618
	    else
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 18619
		console_fprintf(stderr, "getDC failed\n");
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18620
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18621
	    _DeleteObject(rgn, __LINE__);
2755
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18622
	}
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18623
	else
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 18624
	    console_fprintf(stderr, "region creation failed\n");
2755
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18625
	RETURN ( self );
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18626
    }
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18627
%}.
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18628
    self primitiveFailed
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18629
!
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 18630
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18631
topWindowIdsDo:aBlock
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18632
    |l|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18633
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18634
    l := OrderedCollection new.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18635
    self primEnumWindowsInto:l.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18636
    l do:[:eachWindowId |
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18637
	(self getParentWindowIdOfWindowId:eachWindowId) isNil ifTrue:[
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18638
	    "/ a topView
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18639
	    aBlock value:eachWindowId
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18640
	]
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18641
    ].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18642
    ^ nil
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18643
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18644
    "
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18645
     Display topWindowIdsDo:[:id |
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18646
	|nm|
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18647
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18648
	nm := String new:100.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18649
	Transcript showCR:id.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18650
	Display primGetWindowText:id into:nm size:nm size-1.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18651
	Transcript showCR:nm.
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18652
     ].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18653
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18654
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18655
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18656
     |w|
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18657
     Display topWindowIdsDo:[:id |
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18658
	|nm|
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18659
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18660
	nm := String new:100.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18661
	Display primGetWindowText:id into:nm size:nm size-1.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18662
	(nm includesString:'Mortal') ifTrue:[
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18663
	    w := id.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18664
	]
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18665
     ].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18666
     Display resizeWindow:w width:1024 height:1024
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18667
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18668
!
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18669
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18670
unmapWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18671
    "make a window invisible"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18672
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18673
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18674
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18675
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18676
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18677
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18678
	if (win) {
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 18679
	    CPRINTF(("unmapWindow %x\n",win));
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 18680
	    SetWindow_unmapping(win, 1);
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18681
	    ShowWindowAsync(win, SW_HIDE);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18682
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18683
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18684
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18685
%}
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18686
!
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18687
4490
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 18688
unmapWindow:aWindowId animation:animationSymbolorNil time:timeInMillisOrNil
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 18689
    "make a window invisible with some animation effect."
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 18690
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 18691
    self animateWindow:aWindowId show:false animation:animationSymbolorNil time:timeInMillisOrNil
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 18692
!
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 18693
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18694
windowIsIconified:aWindowId
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18695
    "return true, if some window is iconified."
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18696
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18697
%{  /* NOCONTEXT */
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18698
    if (__isExternalAddress(aWindowId)) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18699
	HWND win = _HWNDVal(aWindowId);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18700
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18701
	if (win) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18702
	    if (GetWindow_iconified(win)) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18703
		RETURN (true);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18704
	    }
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18705
	}
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18706
    }
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18707
%}.
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18708
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18709
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18710
4243
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18711
!WinWorkstation methodsFor:'window stuff-native'!
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18712
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18713
enableScrollBar:howSymbol in:aWindowId
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18714
    "native scrollBar widget access"
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18715
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18716
%{
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18717
    if (__isExternalAddress(aWindowId)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18718
	HWND win = _HWNDVal(aWindowId);
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18719
	int how;
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18720
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18721
	if (howSymbol == @symbol(ENABLE_BOTH)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18722
	    how = ESB_ENABLE_BOTH;
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18723
	} else if (howSymbol == @symbol(DISABLE_LTUP)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18724
	    how = ESB_DISABLE_LTUP;
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18725
	} else if (howSymbol == @symbol(DISABLE_RTDN)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18726
	    how = ESB_DISABLE_RTDN;
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18727
	} else if (howSymbol == @symbol(DISABLE_BOTH)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18728
	    how = ESB_DISABLE_BOTH;
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18729
	} else {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18730
	    RETURN ( self );
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18731
	}
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18732
	NDPRINTF(("EnableScrollBar(%d)\n", how));
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18733
	EnableScrollBar(win, SB_CTL, how);
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18734
	RETURN ( self );
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18735
    }
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18736
%}.
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18737
    self primitiveFailed
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18738
!
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18739
4247
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18740
setScrollBarPageSize:sz redraw:redraw in:aWindowId
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18741
    "native scrollBar widget access"
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18742
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18743
%{
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18744
    if (__isExternalAddress(aWindowId)
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18745
     && __isSmallInteger(sz)) {
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18746
	HWND win = _HWNDVal(aWindowId);
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18747
	SCROLLINFO info;
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18748
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18749
	info.cbSize = sizeof(SCROLLINFO);
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18750
	info.nPage = __intVal(sz);
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18751
	info.fMask = SIF_PAGE;
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
 18752
	NDPRINTF2(("SetScrollPage(%d)\n", __intVal(sz)));
4247
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18753
	SetScrollInfo(win, SB_CTL, &info, redraw==true ? 1 : 0);
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18754
	RETURN ( self );
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18755
    }
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18756
%}.
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18757
    self primitiveFailed
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18758
!
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18759
4243
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18760
setScrollPosition:newPosition redraw:redraw in:aWindowId
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18761
    "native scrollBar widget access"
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18762
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18763
%{
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18764
    if (__isExternalAddress(aWindowId)
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18765
     && __isSmallInteger(newPosition)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18766
	HWND win = _HWNDVal(aWindowId);
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18767
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
 18768
	NDPRINTF2(("SetScrollPos(%d)\n", __intVal(newPosition)));
4247
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18769
	SetScrollPos(win, SB_CTL, __intVal(newPosition), redraw==true ? 1 : 0);
4243
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18770
	RETURN ( self );
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18771
    }
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18772
%}.
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18773
    self primitiveFailed
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18774
!
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18775
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18776
setScrollRange:min to:max redraw:redraw in:aWindowId
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18777
    "native scrollBar widget access"
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18778
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18779
%{
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18780
    if (__isExternalAddress(aWindowId)
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18781
     && __bothSmallInteger(min, max)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18782
	HWND win = _HWNDVal(aWindowId);
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18783
4265
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
 18784
	NDPRINTF2(("SetScrollRange(%d..%d)\n", __intVal(min), __intVal(max)));
4247
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 18785
	SetScrollRange(win, SB_CTL, __intVal(min), __intVal(max), redraw==true ? 1 : 0);
4243
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18786
	RETURN ( self );
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18787
    }
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18788
%}.
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18789
    self primitiveFailed
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18790
! !
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 18791
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18792
!WinWorkstation::AlphaBlendParameters methodsFor:'accessing'!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18793
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18794
at:index
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18795
    ^ self instVarAt:index
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18796
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18797
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18798
blueMask
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18799
    ^ blueMask
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18800
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18801
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18802
blueMask:something
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18803
    blueMask := something.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18804
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18805
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18806
greenMask
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18807
    ^ greenMask
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18808
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18809
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18810
greenMask:something
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18811
    greenMask := something.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18812
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18813
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18814
padding
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18815
    ^ padding
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18816
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18817
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18818
padding:something
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18819
    padding := something.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18820
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18821
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18822
redMask
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18823
    ^ redMask
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18824
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18825
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18826
redMask:something
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18827
    redMask := something.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18828
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18829
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18830
sourceAlpha
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18831
    ^ sourceAlpha
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18832
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18833
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18834
sourceAlpha:something
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18835
    sourceAlpha := something.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18836
! !
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18837
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18838
!WinWorkstation::CopyDataStructStructure class methodsFor:'accessing'!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18839
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18840
sizeInBytes
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18841
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18842
    ^ 12
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18843
! !
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18844
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18845
!WinWorkstation::CopyDataStructStructure class methodsFor:'instance creation'!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18846
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18847
new
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18848
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18849
    ^super new: self sizeInBytes
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18850
! !
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18851
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18852
!WinWorkstation::CopyDataStructStructure methodsFor:'accessing'!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18853
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18854
cbData
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18855
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18856
    ^ self doubleWordAt: 4 + 1
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18857
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18858
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18859
cbData: cbData
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18860
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18861
    ^ self doubleWordAt: 4 + 1 put: cbData
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18862
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18863
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18864
dwData
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18865
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18866
    ^ self doubleWordAt: 0 + 1
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18867
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18868
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18869
dwData: dwData
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18870
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18871
    ^ self doubleWordAt: 0 + 1 put: dwData
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18872
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18873
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18874
lpData
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18875
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18876
    ^ self doubleWordAt: 8 + 1
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18877
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18878
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18879
lpData: lpData
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18880
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18881
    ^ self doubleWordAt: 8 + 1 put: lpData
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18882
! !
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18883
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18884
!WinWorkstation::MonitorInfo methodsFor:'accessing'!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18885
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18886
isPrimary
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18887
    ^ isPrimary
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18888
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18889
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18890
name
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18891
    ^ name
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18892
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18893
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18894
screenHeight
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18895
    ^ screenH
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18896
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18897
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18898
screenWidth
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18899
    ^ screenW
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18900
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18901
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18902
screenX
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18903
    ^ screenX
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18904
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18905
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 18906
screenX:screenXArg screenY:screenYArg screenWidth:screenWArg screenHeight:screenHArg
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 18907
    workX:workXArg workY:workYArg workWidth:workWArg workHeight:workHArg
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 18908
    isPrimary:isPrimaryArg name:nameArg
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18909
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18910
    screenX := screenXArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18911
    screenY := screenYArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18912
    screenW := screenWArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18913
    screenH := screenHArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18914
    workX := workXArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18915
    workY := workYArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18916
    workW := workWArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18917
    workH := workHArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18918
    isPrimary := isPrimaryArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18919
    name := nameArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18920
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18921
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18922
screenY
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18923
    ^ screenY
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18924
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18925
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18926
workHeight
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18927
    ^ workH
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18928
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18929
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18930
workWidth
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18931
    ^ workW
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18932
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18933
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18934
workX
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18935
    ^ workX
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18936
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18937
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18938
workY
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18939
    ^ workY
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18940
! !
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18941
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 18942
!WinWorkstation::PrinterDeviceContextHandle class methodsFor:'documentation'!
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 18943
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 18944
documentation
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 18945
"
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 18946
    This is used as a finalization handle for printer contexts
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 18947
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 18948
    [see also:]
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 18949
	DeviceHandle
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 18950
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 18951
    [author:]
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 18952
	Claus Gittinger
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 18953
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 18954
"
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 18955
! !
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 18956
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 18957
!WinWorkstation::PrinterDeviceContextHandle methodsFor:'finalization'!
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 18958
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 18959
finalize
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 18960
    "the PrintingContext for which I am a handle has been collected - tell it to Windows"
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 18961
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 18962
    |id|
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 18963
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 18964
    (id := gcId) notNil ifTrue:[
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 18965
	gcId := nil.
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 18966
	device destroyPrinterDC:id.
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 18967
    ]
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 18968
! !
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 18969
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18970
!WinWorkstation class methodsFor:'documentation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18971
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18972
version
5515
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18973
    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.412 2009-11-11 11:23:05 stefan Exp $'
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 18974
!
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 18975
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 18976
version_CVS
5515
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18977
    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.412 2009-11-11 11:23:05 stefan Exp $'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18978
! !
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 18979
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18980
WinWorkstation initialize!