WinWorkstation.st
author matilk
Wed, 13 Sep 2017 09:40:34 +0200
changeset 8174 2704c965b97b
parent 8173 24ca1712f183
child 8192 53248c9f370b
permissions -rw-r--r--
#BUGFIX by Maren class: DeviceGraphicsContext changed: #displayDeviceOpaqueForm:x:y: nil check
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
     1
"{ Encoding: utf8 }"
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
     2
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     3
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     4
COPYRIGHT (c) 1996 by Claus Gittinger
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     5
	      All Rights Reserved
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     6
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     7
 This software is furnished under a license and may be used
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
     8
 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
     9
 inclusion of the above copyright notice.   This software may not
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    10
 be provided or otherwise made available to, or used by, any
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    11
 other person.  No title to or ownership of the software is
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    12
 hereby transferred.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    13
"
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
    14
"{ Package: 'stx:libview' }"
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
    15
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
    16
"{ NameSpace: Smalltalk }"
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
    17
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    18
DeviceWorkstation subclass:#WinWorkstation
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    19
	instanceVariableNames:'blackpixel whitepixel listOfFonts rootWin rootDC buttonsPressed
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
    20
		eventTrace eventBuffer lastClipboardSequenceNumber'
5598
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
    21
	classVariableNames:'BeepDuration NativeDialogs NativeFileDialogs NativeWidgets
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
    22
		NativeWidgetClassTable StandardColorValues IgnoreSysColorChanges
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
    23
		IgnoreFontChanges SystemColorValues CanEndSession
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
    24
		VerboseNativeDialogs'
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    25
	poolDictionaries:''
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    26
	category:'Interface-Graphics'
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    27
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    28
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    29
Object subclass:#AlphaBlendParameters
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    30
	instanceVariableNames:'sourceAlpha padding redMask greenMask blueMask'
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    31
	classVariableNames:''
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    32
	poolDictionaries:''
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    33
	privateIn:WinWorkstation
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    34
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    35
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    36
ByteArray variableByteSubclass:#CopyDataStructStructure
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    37
	instanceVariableNames:''
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    38
	classVariableNames:''
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    39
	poolDictionaries:''
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    40
	privateIn:WinWorkstation
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    41
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
    42
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    43
Object subclass:#MonitorInfo
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    44
	instanceVariableNames:'screenX screenY screenW screenH workX workY workW workH isPrimary
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    45
		name'
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    46
	classVariableNames:''
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    47
	poolDictionaries:''
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    48
	privateIn:WinWorkstation
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    49
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
    50
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    51
DeviceHandle subclass:#PrinterDeviceContextHandle
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    52
	instanceVariableNames:''
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    53
	classVariableNames:''
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    54
	poolDictionaries:''
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    55
	privateIn:WinWorkstation
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    56
!
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
    57
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    58
!WinWorkstation primitiveDefinitions!
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
    59
%{
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
    60
#define TRACE_ALL_EVENTS      /* */
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
    61
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    62
#define COUNT_RESOURCES       /* */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    63
#define COUNT_BMP_RESOURCES   /* */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    64
#define DEBUG_DELETEOBJECT    /* */
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
    65
#define DEBUG_DC_REUSE        /* */
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    66
#define xxDEBUG_COLORIZE_WM_PAINT_RECTS1
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    67
#define xxDEBUG_COLORIZE_WM_PAINT_RECTS2
4367
0486a7345d7f *** empty log message ***
penk
parents: 4366
diff changeset
    68
#define LOCK_DEBUG
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
    69
#define xxSTARTUP_DISPATCHTHREAD_DEBUG
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    70
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    71
#define ADJUSTWINDOW
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    72
#define ALWAYSTRUECOLOR
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
    73
#define WIN32THREADS
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
    74
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
    75
/* #define DEBUGMASK            /* */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
    76
#define SET_FOCUS_IN_WINTHREAD
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
    77
#define SET_CURSOR_IN_WINTHREAD
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
    78
#define DELAY_ENTER_LEAVE_WHILE_IN_SIZE_MOVE /* */
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
    79
#define xxBEEP_IN_WINTHREAD    /* */
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
    80
#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
    81
#define xxHANDLE_VIEWGRAVITY   /* not yet working */
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
    82
#define HANDLE_DEVICE_EVENTS
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    83
#define COMPRESS_WINDOWPOSCHANGED
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
    84
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
    85
#define USE_DRAW_MUTEX
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
    86
#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
    87
#define LATE_GENERATE_EXPOSE              /* get update region from stx thread */
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
    88
#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
    89
#define xxLATE_CLEAR_FOR_WM_PAINT         /* fill exposed areas with bgColor in ST/X thread (instead of in event-thread) */
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
    90
					  /* seems to be needed to avoid DC conflicts */
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
    91
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
    92
#if 0 /* DOES NOT WORK */
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
    93
# define CACHE_LAST_PEN                  /* remember last pen in gcData */
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
    94
# define CACHE_LAST_BRUSH                /* remember last brush in gcData */
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
    95
# define CACHE_LAST_WM_PAINT_BRUSH       /* remember last viewBackground brush */
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
    96
# define CACHE_LAST_WM_PAINT_DC          /* remember last viewBackground paints dc */
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
    97
# define CACHE_LAST_TMP_FONT             /* */
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
    98
#endif
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
    99
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   100
#define CACHE_PEN
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   101
#define CACHE_BRUSH
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
   102
#define CACHE_LAST_DC                   /* remember last DC in gcData */
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   103
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   104
#ifdef CACHE_PEN
7680
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
   105
# define xNUM_PEN_CACHED       16        /* that many solid pens are globally remembered */
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
   106
# define NUM_PEN_CACHED       64        /* that many solid pens are globally remembered */
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
   107
#else
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
   108
# define NUM_PEN_CACHED       0
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   109
#endif
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   110
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   111
#ifdef CACHE_BRUSH
7680
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
   112
# define xNUM_BRUSH_CACHED     16         /* that many brushes are globally remembered */
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
   113
# define NUM_BRUSH_CACHED     64         /* that many brushes are globally remembered */
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
   114
#else
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
   115
# define NUM_BRUSH_CACHED     0
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   116
#endif
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   117
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   118
#if defined(NO_CLEAR_FOR_WM_PAINT)
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   119
# define WM_PAINT_CLEAR_EARLY       0
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   120
# define WM_PAINT_CLEAR_LATE        0
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   121
#else
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
   122
# if defined(LATE_CLEAR_FOR_WM_PAINT)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   123
#  define WM_PAINT_CLEAR_EARLY       0
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   124
#  define WM_PAINT_CLEAR_LATE        1
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   125
# else
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   126
#  define WM_PAINT_CLEAR_EARLY       1
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
# endif
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
   129
#endif
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
   130
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   131
#undef INT
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   132
#define INT WIN_INT
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   133
#undef Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   134
#define Array WIN_Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   135
#undef Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   136
#define Number WIN_Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   137
#undef Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   138
#define Method WIN_Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   139
#undef Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   140
#define Point WIN_Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   141
#undef Rectangle
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   142
/* #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
   143
#undef True
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   144
#define True WIN_True
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   145
#undef False
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   146
#define False WIN_False
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   147
#undef Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   148
#define Block WIN_Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   149
#undef Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   150
#define Context WIN_Context
2766
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   151
#undef Date
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   152
#define Date WIN_Date
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   153
#undef Time
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   154
#define Time WIN_Time
3119
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   155
#undef Delay
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   156
#define Delay WIN_Delay
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   157
#undef Signal
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   158
#define Signal WIN_Signal
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   159
#undef Set
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   160
#define Set WIN_Set
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   161
#undef Process
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   162
#define Process WIN_Process
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   163
#undef Processor
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   164
#define Processor WIN_Processor
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   165
#undef Message
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   166
#define Message WIN_Message
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   167
#undef String
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   168
#define String WIN_String
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   169
#undef Character
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   170
#define Character WIN_Character
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   171
2328
478ec9b5cbe1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2327
diff changeset
   172
#include <stdio.h>
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
   173
#include <errno.h>
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   174
/* #include <malloc.h> */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   175
/* #include <math.h> */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   176
/* #include <string.h> */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   177
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   178
/*#include <stdarg.h>   */
2328
478ec9b5cbe1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2327
diff changeset
   179
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   180
#ifdef __BORLANDC__
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   181
# define NOATOM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   182
# define NOGDICAPMASKS
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   183
# define NOMETAFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   184
# define NOMINMAX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   185
# define NOOPENFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   186
# define NOSOUND
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   187
# define NOWH
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   188
# define NOCOMM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   189
# define NOKANJI
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   190
# define NOCRYPT
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   191
# define NOMCX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   192
# define WIN32_LEAN_AND_MEAN
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
   193
# ifndef _WIN32_WINNT
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
   194
#  define _WIN32_WINNT 0x0500    /* need this to get certain defines from winuser.h (WM_NCXBUTTONDOWN) */
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
   195
# endif
2310
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>
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
   198
# ifdef HANDLE_DEVICE_EVENTS
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
   199
#  include <dbt.h>
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
   200
# endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   201
# include <sys\timeb.h>
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   202
# include <dir.h>
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
   203
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
   204
#else
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
   205
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   206
# define _USERENTRY /**/
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   207
# define NOATOM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   208
# define NOGDICAPMASKS
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   209
# define NOMETAFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   210
# define NOMINMAX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   211
# define NOOPENFILE
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   212
# define NOSOUND
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   213
# define NOWH
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   214
# define NOCOMM
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   215
# define NOKANJI
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   216
# define NOCRYPT
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   217
# define NOMCX
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   218
# define WIN32_LEAN_AND_MEAN
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
   219
# ifndef _WIN32_WINNT
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
   220
#  define _WIN32_WINNT 0x0500    /* need this to get certain defines from winuser.h (WM_NCXBUTTONDOWN) */
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
   221
# endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   222
# include <windows.h>
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
   223
# ifdef HANDLE_DEVICE_EVENTS
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
   224
#  include <dbt.h>
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
   225
# endif
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   226
# include <shellapi.h>
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   227
# include <sys\timeb.h>
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   228
#endif
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   229
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   230
#ifndef MAXPATH
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
   231
# define MAXPATH 2048   // not defined in MS Visual C 8
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   232
#endif
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   233
3521
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
   234
#include <commdlg.h>
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   235
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   236
#include <process.h>
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   237
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   238
#ifdef __DEF_Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   239
# undef Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   240
# define Array __DEF_Array
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   241
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   242
#ifdef __DEF_Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   243
# undef Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   244
# define Number __DEF_Number
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   245
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   246
#ifdef __DEF_Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   247
# undef Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   248
# define Method __DEF_Method
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   249
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   250
#ifdef __DEF_Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   251
# undef Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   252
# define Point __DEF_Point
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   253
#endif
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   254
#ifdef __DEF_Rectangle
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   255
# undef Rectangle
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   256
# define Rectangle __DEF_Rectangle
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   257
#else
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   258
# undef Rectangle
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
   259
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   260
#ifdef __DEF_Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   261
# undef Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   262
# define Block __DEF_Block
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   263
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   264
#ifdef __DEF_Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   265
# undef Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   266
# define Context __DEF_Context
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   267
#endif
2766
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   268
#ifdef __DEF_Date
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   269
# undef Date
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   270
# define Date __DEF_Date
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   271
#endif
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   272
#ifdef __DEF_Time
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   273
# undef Time
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   274
# define Time __DEF_Time
0774c5887e47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2759
diff changeset
   275
#endif
3119
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   276
# ifdef __DEF_Set
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   277
#  undef Set
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   278
#  define Set __DEF_Set
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   279
# endif
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   280
# ifdef __DEF_Signal
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   281
#  undef Signal
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   282
#  define Signal __DEF_Signal
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   283
# endif
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   284
# ifdef __DEF_Delay
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   285
#  undef Delay
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   286
#  define Delay __DEF_Delay
4365df3a4247 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3117
diff changeset
   287
# endif
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   288
# ifdef __DEF_Process
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   289
#  undef Process
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   290
#  define Process __DEF_Process
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   291
# endif
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   292
# ifdef __DEF_Processor
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   293
#  undef Processor
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   294
#  define Processor __DEF_Processor
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   295
# endif
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   296
# ifdef __DEF_Message
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   297
#  undef Message
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   298
#  define Message __DEF_Message
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   299
# endif
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   300
# ifdef __DEF_String
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   301
#  undef String
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   302
#  define String __DEF_String
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   303
# endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   304
# ifdef __DEF_Character
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   305
#  undef Character
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   306
#  define Character __DEF_Character
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   307
# endif
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   308
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   309
#if 0 /* does not work, anyway */
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   310
#ifndef WM_UNICHAR
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   311
# define WM_UNICHAR                              0x0109
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   312
#endif
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   313
#ifndef UNICODE_NOCHAR
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   314
# define UNICODE_NOCHAR                          0xFFFF
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   315
#endif
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   316
#endif
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
   317
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   318
#undef INT
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   319
#define INT STX_INT
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   320
#undef UINT
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   321
#define UINT STX_UINT
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   322
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   323
/*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   324
 * some defines - tired of typing ...
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   325
 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   326
#define _HANDLEVal(o)        (HANDLE)(__MKCP(o))
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   327
#define _HBITMAPVAL(o)       (HBITMAP)(__MKCP(o))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   328
#define _HWNDVal(o)          (HWND)(__MKCP(o))
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   329
#define _HDCVal(o)           (HDC)(__MKCP(o))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   330
#define _HPALETTEVal(o)      (HPALETTE)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   331
#define _HCURSORVal(o)       (HCURSOR)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   332
#define _HGDIOBJVal(o)       (HGDIOBJ)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   333
#define _LOGPALETTEVal(o)    (LOGPALETTE *)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   334
#define _COLORREFVal(o)      (COLORREF)(__MKCP(o))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   335
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   336
#define _GCDATA(o)           ((struct gcData *)(__MKCP(o)))
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   337
3498
890cfcba79a5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3497
diff changeset
   338
#define WIDECHAR unsigned short
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
   339
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   340
#ifdef LATER
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   341
  /* 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
   342
   * however, there are many more places, where a single static datum is
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
   343
   * used currently - therefore don't care for this - at least now.
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   344
   */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   345
# define __rootDC             (HDC)(__MKCP(__INST(rootDC)))
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   346
#endif
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   347
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   348
#define ISCONNECTED         1
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   349
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   350
struct gcData {
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   351
    union {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   352
	HDC         __hDC;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   353
	struct gcData *__nextFree;
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   354
    } u;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   355
    HWND        hWnd;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   356
    HBITMAP     hBitmap;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   357
    HBITMAP     save_hBitmap;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   358
    HBITMAP     hMask;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   359
    short       clipX;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   360
    short       clipY;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   361
    short       clipW;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   362
    short       clipH;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   363
    char        clipping;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   364
    char        clipByChildren;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   365
    char        bkMode;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
   366
    char        bitmapColorBitCount;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   367
    short       maskOrgX;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   368
    short       maskOrgY;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   369
    short       lineWidth;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   370
    short       fontAscent;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   371
    int         lStyle;   /* is lineStyle | joinStyle | capStyle */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   372
    int         rop2;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   373
    int         bitbltrop2;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   374
    COLORREF    fgColor;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   375
    COLORREF    bgColor;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   376
    HFONT       hFont;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   377
    HFONT       save_hFont;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   378
    HPEN        hPen;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   379
    HPEN        save_hPen;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   380
    HBRUSH      hBrush;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
   381
    HBRUSH      save_hBrush;
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   382
    char        doNotCacheOrRelease;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   383
    char        reserve1;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   384
    char        reserve2;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   385
    char        reserve3;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   386
    char        reserve4;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
   387
    int         reserve5;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   388
};
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
   389
#define _hDC u.__hDC
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   390
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   391
/*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   392
 * some synthetic values
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   393
 */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   394
/*****************************************************************
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   395
 * EVENT DEFINITIONS
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   396
 *****************************************************************/
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   397
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   398
/* 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
   399
   to Grab requests.  Not to be confused with event names.  */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   400
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   401
#define NoEventMask                     0L
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   402
#define KeyPressMask                    (1L<<0)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   403
#define KeyReleaseMask                  (1L<<1)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   404
#define ButtonPressMask                 (1L<<2)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   405
#define ButtonReleaseMask               (1L<<3)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   406
#define EnterWindowMask                 (1L<<4)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   407
#define LeaveWindowMask                 (1L<<5)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   408
#define PointerMotionMask               (1L<<6)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   409
#define PointerMotionHintMask           (1L<<7)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   410
#define Button1MotionMask               (1L<<8)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   411
#define Button2MotionMask               (1L<<9)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   412
#define Button3MotionMask               (1L<<10)
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   413
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   414
# define Button4MotionMask               (1L<<11)
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   415
# define Button5MotionMask               (1L<<12)
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   416
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   417
#define ButtonMotionMask                (1L<<13)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   418
#define KeymapStateMask                 (1L<<14)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   419
#define ExposureMask                    (1L<<15)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   420
#define VisibilityChangeMask            (1L<<16)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   421
#define StructureNotifyMask             (1L<<17)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   422
#define ResizeRedirectMask              (1L<<18)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   423
#define SubstructureNotifyMask          (1L<<19)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   424
#define SubstructureRedirectMask        (1L<<20)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   425
#define FocusChangeMask                 (1L<<21)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   426
#define PropertyChangeMask              (1L<<22)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   427
#define ColormapChangeMask              (1L<<23)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   428
#define OwnerGrabButtonMask             (1L<<24)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   429
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   430
/* 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
   431
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
   432
are reserved in the protocol for errors and replies. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   433
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   434
#define KeyPress                2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   435
#define KeyRelease              3
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   436
#define ButtonPress             4
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   437
#define ButtonRelease           5
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   438
#define MotionNotify            6
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   439
#define EnterNotify             7
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   440
#define LeaveNotify             8
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   441
#define FocusIn                 9
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   442
#define FocusOut                10
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   443
#define KeymapNotify            11
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   444
#define Expose                  12
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   445
#define GraphicsExpose          13
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   446
#define NoExpose                14
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   447
#define VisibilityNotify        15
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   448
#define CreateNotify            16
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   449
#define DestroyNotify           17
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   450
#define UnmapNotify             18
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   451
#define MapNotify               19
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   452
#define MapRequest              20
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   453
#define ReparentNotify          21
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   454
#define ConfigureNotify         22
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   455
#define ConfigureRequest        23
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   456
#define GravityNotify           24
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   457
#define ResizeRequest           25
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   458
#define CirculateNotify         26
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   459
#define CirculateRequest        27
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   460
#define PropertyNotify          28
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   461
#define SelectionClear          29
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   462
#define SelectionRequest        30
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   463
#define SelectionNotify         31
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   464
#define ColormapNotify          32
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   465
#define ClientMessage           33
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   466
#define MappingNotify           34
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   467
#define LASTEvent               35      /* must be bigger than any event # */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   468
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   469
/* 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
   470
   state in various key-, mouse-, and button-related events. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   471
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   472
/* modifier names.  Used to build a SetModifierMapping request or
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   473
   to read a GetModifierMapping request.  These correspond to the
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   474
   masks defined above. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   475
#define ShiftMapIndex           0
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   476
#define LockMapIndex            1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   477
#define ControlMapIndex         2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   478
#define Mod1MapIndex            3
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   479
#define Mod2MapIndex            4
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   480
#define Mod3MapIndex            5
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   481
#define Mod4MapIndex            6
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   482
#define Mod5MapIndex            7
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   483
4946
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   484
#define ShiftMask               (1<<ShiftMapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   485
#define LockMask                (1<<LockMapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   486
#define ControlMask             (1<<ControlMapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   487
#define Mod1Mask                (1<<Mod1MapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   488
#define Mod2Mask                (1<<Mod2MapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   489
#define Mod3Mask                (1<<Mod3MapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   490
#define Mod4Mask                (1<<Mod4MapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   491
#define Mod5Mask                (1<<Mod5MapIndex)
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   492
2151
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
/* 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
   495
   with button names below. */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   496
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   497
#define Button1Mask            Button1MotionMask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   498
#define Button2Mask            Button2MotionMask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   499
#define Button3Mask            Button3MotionMask
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   500
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   501
# define Button4Mask            Button4MotionMask
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   502
# define Button5Mask            Button5MotionMask
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   503
#endif
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   504
#define AnyButtonMask           (Button1Mask|Button2Mask|Button3Mask)
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   505
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   506
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   507
# define AnyModifier             (1<<15)  /* used in GrabButton, GrabKey */
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   508
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   509
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   510
/* 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
   511
   and ButtonRelease events.  Not to be confused with button masks above.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   512
   Note that 0 is already defined above as "AnyButton".  */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   513
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   514
#define Button1                 1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   515
#define Button2                 2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   516
#define Button3                 3
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   517
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   518
# define Button4                 4
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   519
# define Button5                 5
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   520
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   521
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   522
#define CAPTURE_NONE     0
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   523
#define CAPTURE_IMPLICIT 7
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   524
#define CAPTURE_EXPLICIT 8
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
   525
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   526
#define BK_UNDEF         0
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   527
#define BK_TRANSPARENT   1
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   528
#define BK_OPAQUE        2
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
   529
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   530
#define GRAVITY_NONE        0
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   531
#define GRAVITY_S           1
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   532
#define GRAVITY_SW          2
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   533
#define GRAVITY_SE          3
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   534
#define GRAVITY_N           4
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   535
#define GRAVITY_NW          5
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   536
#define GRAVITY_NE          6
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   537
#define GRAVITY_E           7
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   538
#define GRAVITY_W           8
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   539
4946
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   540
#if 0
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   541
# define ControlMask            8
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   542
# define ShiftMask              16
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
   543
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   544
#define LeftAltMask            Mod1Mask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   545
#define RightAltMask           Mod2Mask
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   546
#define TRANSLATED_KEY         Mod5Mask
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   547
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   548
#define WIN32PADDING 32
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
   549
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   550
/*
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   551
 * synthetic events
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   552
 */
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   553
#define __WM_MOUSEENTER        0x10001
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   554
#define __WM_MOUSELEAVE        0x10002
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   555
#define __WM_GEXPOSE           0x10003
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   556
#define __WM_NOGEXPOSE         0x10004
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   557
#define __WM_ICONIFIED         0x10005
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
   558
#define __WM_PAINT             0x10006
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
   559
1920
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   560
static int AltMask = RightAltMask;
ad75cae453f7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1912
diff changeset
   561
static int MetaMask = LeftAltMask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   562
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   563
#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
   564
#define BlackPixel     RGB(0, 0, 0)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   565
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   566
/* #undef DEBUG /* */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   567
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   568
#ifdef DEBUG
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   569
# define PRINTF(x)              { console_printf x;}
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
   570
# define CPRINTF(x)             { if (__debug__ % 1) console_printf x;}
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   571
# define RESPRINTF(x)           /*{ if (__debug__) console_printf x;}*/
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   572
# define RES1PRINTF(x)          /*{ if (__debug__) console_printf x;}*/
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   573
# define RES_BMP_PRINTF(x)      /*{ if (__debug__) console_printf x;}*/
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   574
# define TH_DPRINTF(x)          /*{ if (__debug__) console_printf x;}*/
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   575
# define DPRINTF(x)             { if (__debug__) console_printf x;}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   576
# define NDPRINTF(x)            { if (__debugNative__) console_printf x;}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   577
# define NDPRINTF2(x)           { if (__debugNative__ > 1) console_printf x;}
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
   578
# define DDPRINTF(x)            { if (__debug__ & 2) console_printf x;}
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
   579
# define DDDPRINTF(x)           { if (__debug__ & 4) console_printf x;}
6165
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
   580
# define DDDDPRINTF(x)          { if (__debug__ & 16) console_printf x;}
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
   581
# define BMDPRINTF(x)           { if (__debug__ & 2) console_printf x;}
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
   582
# define EVENT_PRINTF(x)        { if (__debug__ & 8) console_printf x;}
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
   583
# define EVENT_PRINTF2(x)       { if (__debug__ & 4) console_printf x;}
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   584
# define EVENT_PRINTF3(x)       /* */
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   585
# define DPRINTFIF(flag, x)                 { if (flag) console_printf x;}
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   586
# define EVENT_PRINTFIF(flag, x)            { if (flag && __debug__) console_printf x;}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   587
# 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
   588
# 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
   589
#else
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   590
# define PRINTF(x)              /* */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   591
# define CPRINTF(x)             /* */
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   592
# define RES_BMP_PRINTF(x)      /* */
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   593
# define RESPRINTF(x)           /* */
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   594
# define RES1PRINTF(x)          /* */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   595
# define TH_DPRINTF(x)          /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   596
# define DPRINTF(x)             /* */
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
   597
# define NDPRINTF(x)            /* */
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
   598
# define NDPRINTF2(x)           /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   599
# define DDPRINTF(x)            /* */
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
   600
# define DDDPRINTF(x)           /* */
6165
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
   601
# define DDDDPRINTF(x)          /* */
4351
b19ce9513305 get bits from screen fixed
Claus Gittinger <cg@exept.de>
parents: 4328
diff changeset
   602
# define BMDPRINTF(x)           /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   603
# define EVENT_PRINTF(x)        /* */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   604
# define EVENT_PRINTF2(x)       /* */
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
   605
# define EVENT_PRINTF3(x)       /* */
4265
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
   606
# define DPRINTFIF(flag, x)             /* */
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   607
# define EVENT_PRINTFIF(flag, x)        /* */
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   608
# define UNHANDLED_EVENT_PRINTF(x)      /* */
5342
516a8f20d81d Use TextOutA to write one-byte-strings.
Stefan Vogel <sv@exept.de>
parents: 5338
diff changeset
   609
# define UNHANDLED_EVENT_PRINTFIF(flag, x)    /* */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   610
#endif
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   611
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
   612
extern void __internalError(char *);
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
   613
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
   614
/* # define EVENT_PRINTF(x)        { printf x;} */
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
   615
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   616
#define INFOFPRINTF(__x__)                 \
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
   617
    if (@global(InfoPrinting) == true) { \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   618
	console_fprintf __x__;           \
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   619
    }
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   620
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
   621
#define DEBUGFPRINTF(__x__)                 \
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
   622
    if (@global(InfoPrinting) == true) { \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   623
	console_fprintf __x__;           \
3469
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
   624
    }
7e157b8e7a9e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3416
diff changeset
   625
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   626
#define BR_SOLID       0
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   627
#define BR_PATTERN     1
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   628
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   629
#define LINE_SOLID     0
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   630
#define LINE_DASH      1
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   631
#define LINE_DDASH     2
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   632
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   633
#ifdef KEEP_STD_CURSORS
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   634
# define _C_ARROW       1
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   635
# define _C_CROSS       2
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   636
# define _C_IBEAM       3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   637
# define _C_ICON        4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   638
# define _C_NO          5
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   639
# define _C_SIZE        6
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   640
# define _C_SIZEALL     7
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   641
# define _C_SIZENESW    8
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   642
# define _C_SIZENS      9
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   643
# define _C_SIZENWSE    10
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   644
# define _C_UPARROW     11
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   645
# define _C_WAIT        12
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   646
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   647
 static HCURSOR H_C_ARROW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   648
 static HCURSOR H_C_CROSS = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   649
 static HCURSOR H_C_IBEAM = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   650
 static HCURSOR H_C_ICON = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   651
 static HCURSOR H_C_NO = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   652
 static HCURSOR H_C_SIZE = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   653
 static HCURSOR H_C_SIZEALL = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   654
 static HCURSOR H_C_SIZENESW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   655
 static HCURSOR H_C_SIZENS = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   656
 static HCURSOR H_C_SIZENWSE = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   657
 static HCURSOR H_C_UPARROW = (HCURSOR)0;
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   658
 static HCURSOR H_C_WAIT = (HCURSOR)0;
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
   659
 static HCURSOR H_C_APPSTARTING = (HCURSOR)0;
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
   660
#endif /* KEEP_STD_CURSORS */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   661
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   662
#ifdef EXIT_WITH_3_CTRL_Cs
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
   663
static int ctrl_c_count = 0;            /* CTRL-C count */
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
   664
#endif
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
   665
#ifdef RELEASE_CAPTURE_WITH_3_ESCAPEs
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
   666
static int escape_count = 0;            /* ESCAPE count */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   667
#endif
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   668
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   669
static int evRootX, evRootY;
4476
4ba4a3ac09bc fix: double click in popup windows (affects ExtendedComboBox)
Claus Gittinger <cg@exept.de>
parents: 4462
diff changeset
   670
static int multiClickCount = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   671
static UINT lastMSGTime;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   672
static UINT lastMouseWheelTime = 0;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   673
static int lastClickX, lastClickY;
3584
194203bc4370 last mouse motion
Claus Gittinger <cg@exept.de>
parents: 3583
diff changeset
   674
static int lastMotionX = -9999, lastMotionY = -9999;
194203bc4370 last mouse motion
Claus Gittinger <cg@exept.de>
parents: 3583
diff changeset
   675
static HWND lastMotionWnd = 0;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   676
static int deltaDoubleClickX = -999;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   677
static int deltaDoubleClickY = -999;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   678
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
   679
static OBJ lastButton = 0;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   680
static int inSizeMove = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   681
static int inSize = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   682
static int inMove = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   683
static HWND needDelayedMouseLeaveWindow = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   684
static HWND needDelayedMouseEnterWindow = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   685
static int delayedMouseEnterX, delayedMouseEnterY;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   686
static int destroyWin;
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   687
static HDC   __tmpDC;
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
   688
#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
   689
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
   690
#endif
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
   691
static int __logPixelSY;
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
   692
3714
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   693
static int __isWinXP = 0;
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
   694
static int __isWin2k = 0;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
   695
static int __isWinVista = 0;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
   696
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   697
#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
   698
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
   699
static int            lastGcOwnerThreadID = 0;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   700
static HWND           lastGcHWIN;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   701
static HBITMAP        lastGcHBITMAP;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   702
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
   703
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   704
#ifndef __rootDC
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   705
 static HDC __rootDC;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
   706
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   707
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   708
#ifdef CACHE_PEN
5342
516a8f20d81d Use TextOutA to write one-byte-strings.
Stefan Vogel <sv@exept.de>
parents: 5338
diff changeset
   709
static struct __penCache {
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   710
    HPEN            pen;
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
   711
    unsigned int    clr;
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
   712
} __penCache[NUM_PEN_CACHED];
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   713
#endif
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   714
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
   715
#ifdef CACHE_BRUSH
5342
516a8f20d81d Use TextOutA to write one-byte-strings.
Stefan Vogel <sv@exept.de>
parents: 5338
diff changeset
   716
static struct __brushCache {
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   717
    HBRUSH          brush;
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
   718
    unsigned int    clr;
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
   719
} __brushCache[NUM_BRUSH_CACHED];
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   720
#endif
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
   721
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   722
/*
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   723
 * globally cached - never released
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   724
 */
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   725
static HPEN __blackPen = 0;
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
   726
static HPEN __whitePen = 0;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   727
static HPEN __nullPen = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   728
static HBRUSH __blackBrush = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   729
static HBRUSH __whiteBrush = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
   730
2620
519011e49878 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2619
diff changeset
   731
static HPEN __bgPen = 0;
519011e49878 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2619
diff changeset
   732
static int __bgPenColor = 0;
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
   733
5964
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
   734
#define WM_THREAD_CREATEWINDOW     (WM_USER + 0x101)
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
   735
#define WM_THREAD_DESTROYWINDOW    (WM_USER + 0x102)
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
   736
#define WM_THREAD_SETFOCUS         (WM_USER + 0x103)
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
   737
#define WM_THREAD_SETCAPTURE       (WM_USER + 0x104)
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
   738
#define WM_THREAD_SETCURSOR        (WM_USER + 0x105)
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
   739
#define WM_THREAD_BEEP             (WM_USER + 0x106)
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
   740
#define WM_THREAD_REGISTERHOTKEY   (WM_USER + 0x107)
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
   741
#define WM_THREAD_UNREGISTERHOTKEY (WM_USER + 0x108)
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
   742
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
   743
#define WM_TRAY_MESSAGE          (WM_USER + 0x200)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   744
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   745
#define hasEventQueued() (eventQueueHead != NULL)
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
   746
#define EVENT_THREAD_STACKSIZE  (4096*10)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   747
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   748
typedef int (*intf)(int);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   749
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   750
/*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   751
 * 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
   752
 */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   753
#define LI_TOPWIN       0x0001
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   754
#define LI_INPUTWIN     0x0002
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
   755
#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
   756
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
   757
typedef struct {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   758
	HCURSOR         hCursor;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   759
	HBRUSH          viewBgBrush;  /* if that is nil, it has a solid bg color */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   760
	COLORREF        viewBgColor;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   761
	int             eventMask;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   762
	short           flag;         /* LI_ - flags bits */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   763
	short           minWidth;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   764
	short           maxWidth;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   765
	short           minHeight;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   766
	short           maxHeight;
6494
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
   767
	short           currentMonitorWidth;
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
   768
	short           currentMonitorHeight;
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   769
	short           bw;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   770
	unsigned char   iconified;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   771
	unsigned char   viewGravity;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   772
	unsigned char   unmapping;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   773
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   774
	short           bgOffsX;      /* bg-pattern offset */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   775
	short           bgOffsY;      /* bg-pattern offset */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   776
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   777
	short           mouseX;       /* last mouseX */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   778
	short           mouseY;       /* last mouseY */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   779
	COLORREF        bdColor;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   780
} localWindowInfo;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   781
typedef localWindowInfo *plocalWindowInfo;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   782
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   783
typedef struct createWindowInfo {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   784
	localWindowInfo *localWindowInfo;  /* in param */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   785
	HANDLE          newWinHandle;      /* out param */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   786
	wchar_t         *windowName;       /* in params */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   787
	wchar_t         *className;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   788
	int             winStyleBits;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   789
	int             winStyleBitsEx;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   790
	HANDLE          parentHandle;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   791
	int             x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   792
	int             y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   793
	int             dx;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   794
	int             dy;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   795
	HANDLE          hCreateEvent;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   796
	short           infoWasRead;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   797
	unsigned short  sequenceNr;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   798
	unsigned        errCode;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   799
} createWindowInfo;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
   800
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   801
#define INVALIDATED_CWI 0xFFFF             /* seqNr for invalidated CWI */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   802
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   803
static createWindowInfo *pendingCREATEWINDOWInfo = 0;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   804
static unsigned short pendingSequenceNr = INVALIDATED_CWI;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
   805
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   806
#define N_WINDOW_PRIVATE (sizeof(plocalWindowInfo))
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   807
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   808
#ifdef _WIN64
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   809
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   810
# define GWL_LOCALINFO  GWLP_USERDATA
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   811
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   812
# define SETLOCALWINDOWINFOPTR(__hWnd__,__ptr__) \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   813
	SetWindowLongPtr(__hWnd__, GWL_LOCALINFO , (LONG_PTR)__ptr__)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   814
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   815
# define GETLOCALWINDOWINFOPTR(__hWnd__) \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   816
	((localWindowInfo *)GetWindowLongPtr(__hWnd__, GWL_LOCALINFO))
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   817
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   818
#else
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   819
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
   820
# define GWL_LOCALINFO  GWL_USERDATA
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   821
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   822
# define SETLOCALWINDOWINFOPTR(__hWnd__,__ptr__) \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   823
	SetWindowLong(__hWnd__, GWL_LOCALINFO , (DWORD)__ptr__)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   824
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   825
# define GETLOCALWINDOWINFOPTR(__hWnd__) \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   826
	((localWindowInfo *)GetWindowLong(__hWnd__, GWL_LOCALINFO))
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   827
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   828
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   829
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   830
#define SetWindow_Cursor(__hWnd__, __hCurs__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   831
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->hCursor = __hCurs__) : 0)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   832
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   833
#define GetWindow_Cursor(__hWnd__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   834
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->hCursor : 0)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   835
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   836
#define SetWindow_viewBgColor(__hWnd__, __viewBgColor__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   837
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->viewBgColor = __viewBgColor__) : 0)
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   838
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   839
#define GetWindow_viewBgColor(__hWnd__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   840
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->viewBgColor : 0)
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   841
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
   842
#define SetWindow_bdColor(__hWnd__, __bdColor__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   843
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->bdColor = __bdColor__) : 0)
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
   844
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
   845
#define GetWindow_bdColor(__hWnd__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   846
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->bdColor : 0)
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
   847
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   848
#define SetWindow_iconified(__hWnd__, __iconified__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   849
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->iconified = __iconified__) : 0)
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   850
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   851
#define GetWindow_iconified(__hWnd__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   852
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->iconified : 0)
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
   853
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   854
#define SetWindow_unmapping(__hWnd__, __unmapping__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   855
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->unmapping = __unmapping__) : 0)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   856
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   857
#define GetWindow_unmapping(__hWnd__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   858
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->unmapping : 0)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   859
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   860
#define SetWindow_mouseX(__hWnd__, __mouseX__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   861
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->mouseX = __mouseX__) : 0)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   862
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   863
#define GetWindow_mouseX(__hWnd__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   864
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->mouseX : 0)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   865
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   866
#define SetWindow_mouseY(__hWnd__, __mouseY__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   867
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->mouseY = __mouseY__) : 0)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   868
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   869
#define GetWindow_mouseY(__hWnd__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   870
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->mouseY : 0)
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   871
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   872
#define SetWindow_mouseXY(__hWnd__, __mouseX__, __mouseY__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   873
	{ SetWindow_mouseX(__hWnd__, __mouseX__); SetWindow_mouseY(__hWnd__, __mouseY__); }
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   874
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   875
#define SetWindow_viewBgBrush(__hWnd__, __viewBgBrush__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   876
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->viewBgBrush = __viewBgBrush__) : (HBRUSH)0)
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   877
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
   878
#define GetWindow_viewBgBrush(__hWnd__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   879
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->viewBgBrush : (HBRUSH)0)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   880
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   881
#define SetWindow_bw(__hWnd__, __bw__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   882
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->bw = __bw__) : 0)
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   883
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   884
#define GetWindow_bw(__hWnd__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   885
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->bw : 0)
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   886
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   887
#define GetWindow_paintInfoPtr(__hWnd__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   888
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? &(GETLOCALWINDOWINFOPTR(__hWnd__)->paintInfo) : 0)
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   889
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   890
#define SetWindow_flag(__hWnd__, __flag__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   891
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->flag = __flag__) : 0)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   892
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   893
#define GetWindow_flag(__hWnd__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   894
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? GETLOCALWINDOWINFOPTR(__hWnd__)->flag : 0)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   895
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   896
#define GetWindow_eventMask(__hWnd__) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   897
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->eventMask) : 0)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
   898
6494
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
   899
#define SetWindow_currentMonitorWidth(__hWnd__, __width__) \
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
   900
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->currentMonitorWidth = __width__) : 0)
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
   901
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
   902
#define SetWindow_currentMonitorHeight(__hWnd__, __height__) \
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
   903
	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->currentMonitorHeight = __height__) : 0)
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
   904
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
   905
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   906
struct queuedEvent {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   907
	struct queuedEvent     *ev_next;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   908
	int                     count;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   909
	int                     ev_flag;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   910
	HWND                    ev_hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   911
	UINT                    ev_message;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   912
	UINT                    ev_wParam;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   913
	INT                     ev_arg1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   914
	INT                     ev_arg2;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   915
	INT                     ev_arg3;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   916
	INT                     ev_arg4;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   917
	UINT                    ev_time;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   918
};
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   919
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   920
#define ev_x    ev_arg1
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   921
#define ev_y    ev_arg2
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   922
#define ev_w    ev_arg3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   923
#define ev_h    ev_arg4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   924
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   925
#define ev_keyCode   ev_wParam
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   926
#define ev_scanCode  ev_arg3
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   927
#define ev_modifiers ev_arg4
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
   928
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
   929
#define EV_CHUNK_CNT    10000
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
   930
#define xxEV_CHUNK_CNT    1000
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   931
#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
   932
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   933
#define BITBLT_COPY             SRCCOPY
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   934
#define BITBLT_COPYINVERTED     NOTSRCCOPY
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   935
#define BITBLT_XOR              SRCINVERT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   936
#define BITBLT_AND              SRCAND
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   937
#define BITBLT_OR               SRCPAINT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   938
5958
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
   939
typedef struct registerHotKeyInfo {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   940
	HANDLE       hwnd;          /* in param */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   941
	int          hotKeyId;      /* in param */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   942
	unsigned int modifier;      /* in param */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
   943
	unsigned int virtualKey;    /* in params */
5958
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
   944
} registerHotKeyInfo;
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
   945
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   946
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   947
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   948
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   949
!WinWorkstation primitiveVariables!
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   950
%{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   951
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   952
static int firstInstance = 1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   953
static char *app_name = "ST/X";
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   954
static char *app_nameRoot = "ST/X:Root";
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
   955
static char *app_namePopup = "ST/X:Popup";
3714
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   956
static char *app_nameDialog = "ST/X:Dialog";
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   957
static wchar_t wapp_name[] = { 'S','T','/','X',0 };
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   958
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
   959
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
   960
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
   961
static int __debug__ = 0;
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
   962
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
   963
static int __debug_WM_ALL__ = 0;
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   964
static int __debug_WM_MOUSEENTER__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   965
static int __debug_WM_MOUSELEAVE__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   966
static int __debug_WM_MOUSEMOVE__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   967
static int __debug_WM_MOUSEACTIVATE__ = 0;
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
   968
static int __debug_WM_CHAR__ = 0;
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   969
static int __debug_WM_KEYUP__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   970
static int __debug_WM_KEYDOWN__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   971
static int __debug_WM_BUTTONUP__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   972
static int __debug_WM_BUTTONDOWN__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   973
static int __debug_WM_PAINT__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   974
static int __debug_WM_MOVING__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   975
static int __debug_WM_ERASEBKGND__ = 0;
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
   976
static int __debug_WM_SETTEXT__ = 0;
4265
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
   977
static int __debug_WM_CTLCOLORSCROLLBAR__ = 0;
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
   978
static int __debug_WM_GETICON__ = 0;
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
   979
static int __debug_WM_EXPOSE__ = 0;
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
   980
static int __debug_WM_SIZE__ = 0;
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
   981
static int __debug_WM_WINDOWPOSCHANGING__ = 0;
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
   982
static int __debug_WM_COPYDATA__ = 0;
5230
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
   983
static int __debug_WM_DROPFILES__ = 0;
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
   984
static int __debug_WM_SHOWWINDOW__ = 0;
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
   985
static int __debug_WM_SETCURSOR__ = 0;
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
   986
static int __debug_WM_FOCUS__ = 0;
5230
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
   987
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
   988
static int __debugNative__ = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   989
static int __depth;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   990
static int __realDepth;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   991
static HWND __rootWin = NULL;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   992
static HWND __rootWinSpezial = NULL;
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   993
#if 0
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
   994
static HDESK __rootDesk;
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
   995
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
   996
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
   997
static int __activateOnClick = 1;
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
   998
static int __focusFollowsMouse = 0;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
   999
static int __eatingMouseEvents = 0;
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  1000
static int __ignoreButtonPressOnActivate = 0;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1001
static int __rightButtonIsLowerWindow = 1;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1002
static int __shiftedLeftButtonIsLowerWindow = 1;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1003
static int __currentCapture = CAPTURE_NONE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1004
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1005
static HANDLE __currentPointerView = (HANDLE)0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1006
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1007
/* MessageDispatchThread */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1008
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1009
#ifndef WIN32THREADS
4448
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
  1010
static HANDLE _masterThread = NULL;
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
  1011
#endif
4443
96e956cf9acf plugin stuff now in librun
Claus Gittinger <cg@exept.de>
parents: 4441
diff changeset
  1012
static DWORD _masterThreadId = 0;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1013
static DWORD _dispatchThreadId = 0;
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  1014
static DWORD _dispatchThreadId2 = 0;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1015
#ifdef LOCK_DEBUG
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1016
static int lockCountEvents = 0;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1017
#endif
4448
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
  1018
static HANDLE hEventsMutex = NULL;
4504
0f0a6f7fabd5 lockEvent bug (workaround ?)
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1019
static char *hEventsMutexOwner = NULL;
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1020
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  1021
#ifdef USE_PAINT_MUTEX
4448
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
  1022
static HANDLE hPaintMutex = NULL;
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1023
# define AQUIRE_PAINT_MUTEX    { WaitForSingleObject(hPaintMutex, 100L); }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1024
# define RELEASE_PAINT_MUTEX   { ReleaseMutex(hPaintMutex);              }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1025
#else
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1026
# define AQUIRE_PAINT_MUTEX    { /* nothing */ }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1027
# define RELEASE_PAINT_MUTEX   { /* nothing */ }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1028
#endif
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1029
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1030
#ifdef USE_DRAW_MUTEX
4448
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
  1031
static HANDLE hDrawMutex = NULL;
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1032
# define AQUIRE_DRAW_MUTEX     { WaitForSingleObject(hDrawMutex, 100L);  }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1033
# define RELEASE_DRAW_MUTEX    { ReleaseMutex(hDrawMutex);  }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1034
#else
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1035
# define AQUIRE_DRAW_MUTEX     { /* nothing */ }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1036
# define RELEASE_DRAW_MUTEX    { /* nothing */ }
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1037
#endif
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  1038
4448
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
  1039
static HANDLE hCreateEvent = NULL;
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
  1040
static HANDLE hNeverTriggered = NULL;
e0a48f445d17 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4445
diff changeset
  1041
static HANDLE hInputEvent = NULL;
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  1042
static HANDLE hDispatchThreadRunningEvent = NULL;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1043
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1044
#ifdef COUNT_RESOURCES
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1045
 static int __cnt_gcData;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1046
 static int __cnt_createWindows;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1047
 static int __cnt_cur;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1048
 static int __cnt_font;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1049
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1050
#ifdef COUNT_BMP_RESOURCES
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1051
 static int __cnt_bitmap;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1052
#endif
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1053
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1054
static struct queuedEvent *eventFreeList  = (struct queuedEvent *) 0;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1055
static struct queuedEvent *eventQueueHead = (struct queuedEvent *) 0;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1056
static struct queuedEvent *eventQueueTail = (struct queuedEvent *) 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1057
static int eventsendcount = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1058
static int eventempfcount = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1059
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1060
/*
2754
21cbbc8fbe09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
  1061
 * 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
  1062
 * (away from free/malloc)
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1063
 */
7680
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  1064
#define xNUM_FREE_GC     50
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  1065
#define NUM_FREE_GC     150
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1066
static struct gcData *gcDataFreeList = (struct gcData *)0;
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1067
static int gcDataNumFree = 0;
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1068
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1069
/*
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1070
 * remember the last background-paint brush
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1071
 * will be reused by next bg-paint, if it needs
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1072
 * the same color. Otherwise, the next bg-erase
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1073
 * will destroy this brush.
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1074
 */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1075
#ifdef CACHE_LAST_WM_PAINT_BRUSH
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1076
 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
  1077
 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
  1078
#endif
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1079
#ifdef CACHE_LAST_WM_PAINT_DC
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1080
 static HWND last_wm_paint_win = 0;
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1081
 static HDC  last_wm_paint_dc = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1082
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1083
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1084
#ifdef COMPRESS_WINDOWPOSCHANGED
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1085
 static HWND lastPos_win = 0;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1086
 static int lastPos_w;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1087
 static int lastPos_h;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1088
 static int lastPos_x;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1089
 static int lastPos_y;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  1090
#endif
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1091
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1092
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1093
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1094
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1095
!WinWorkstation primitiveFunctions!
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1096
%{
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1097
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1098
extern HANDLE __getHInstance();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1099
5342
516a8f20d81d Use TextOutA to write one-byte-strings.
Stefan Vogel <sv@exept.de>
parents: 5338
diff changeset
  1100
static void __debugEvent__() {}
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1101
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1102
#ifdef DEBUGMASK
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1103
static void
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  1104
printMask(int mask) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1105
	if (mask & KeyPressMask)        console_printf("KeyPressMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1106
	if (mask & KeyReleaseMask)      console_printf("KeyReleaseMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1107
	if (mask & ButtonPressMask)     console_printf("ButtonPressMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1108
	if (mask & ButtonReleaseMask)   console_printf("ButtonReleaseMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1109
	if (mask & ButtonMotionMask)    console_printf("ButtonMotionMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1110
	if (mask & PointerMotionMask)   console_printf("PointerMotionMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1111
	if (mask & ExposureMask)        console_printf("ExposureMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1112
	if (mask & FocusChangeMask)     console_printf("FocusChangeMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1113
	if (mask & EnterWindowMask)     console_printf("EnterWindowMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1114
	if (mask & LeaveWindowMask)     console_printf("LeaveWindowMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1115
	if (mask & KeymapStateMask)     console_printf("KeymapStateMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1116
	if (mask & VisibilityChangeMask)console_printf("VisibilityChangeMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1117
	if (mask & StructureNotifyMask) console_printf("StructureNotifyMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1118
	if (mask & ResizeRedirectMask)  console_printf("ResizeRedirectMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1119
	if (mask & PropertyChangeMask)  console_printf("PropertyChangeMask\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1120
	if (mask & ColormapChangeMask)  console_printf("ColormapChangeMask\n");
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1121
}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1122
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1123
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1124
static int
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1125
st2RGB(int color, struct gcData *gcData)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1126
{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1127
	if (gcData && gcData->bitmapColorBitCount == 1) {
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1128
	    return (color ? WhitePixel : BlackPixel);
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1129
	}
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  1130
#ifdef ALWAYSTRUECOLOR
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1131
	return (color & 0xffffff);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1132
#else
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1133
	if (__depth < 15) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1134
	    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1135
	} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1136
	    if ((__depth == 16) || (__depth == 15)) {
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1137
		int ib = (color & 0x1f) << 3;
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1138
		int ig = ((color >> 5) & 0x3f) << 2;
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1139
		int ir = ((color >> 11) & 0x1f) << 3;
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1140
		ir |= 7;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1141
		ig |= 3;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1142
		ib |= 7;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1143
		return RGB(ir,ig,ib);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1144
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1145
	    return (color & 0xffffff);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1146
	}
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  1147
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1148
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1149
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1150
static int
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1151
RGB2st(int r, int g, int b)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1152
{
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1153
	int ir,ig,ib,id;
2418
1c4566aeee44 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2417
diff changeset
  1154
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  1155
#ifdef ALWAYSTRUECOLOR
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1156
	ir = (r >> 8) & 0xff;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1157
	ig = (g >> 8) & 0xff;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1158
	ib = (b >> 8) & 0xff;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1159
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1160
	id = RGB( ir, ig, ib);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1161
#else
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1162
	if (__depth < 15) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1163
	    id = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1164
	} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1165
	    if ((__depth == 16) || (__depth == 15)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1166
		ir = (r >> 11) & 0x1f;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1167
		ig = (g >> 10) & 0x3f;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1168
		ib = (b >> 11) & 0x1f;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1169
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1170
		id = ( ir << 11 ) | ( ig << 5 ) | ib;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1171
	    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1172
		ir = (r >> 8) & 0xff;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1173
		ig = (g >> 8) & 0xff;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1174
		ib = (b >> 8) & 0xff;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1175
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1176
		id = RGB( ir, ig, ib);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1177
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1178
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1179
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1180
	return id;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1181
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1182
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1183
#if 0
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1184
/*
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1185
 * return a windows top-window
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1186
 */
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1187
static HWND
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1188
GetTopParent(HWND hwnd)
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1189
{
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1190
	HWND lastParent = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1191
	HWND nextParent;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1192
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1193
	while (nextParent = GetParent(lastParent)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1194
	    lastParent = nextParent;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1195
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1196
	return lastParent;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1197
}
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1198
#endif
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  1199
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1200
#ifdef DEBUG_DELETEOBJECT
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1201
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1202
static int
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  1203
_DeleteObject(HANDLE o, int lineNr)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1204
{
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1205
    int r = DeleteObject(o);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1206
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1207
    if (r == 0)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1208
	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
  1209
    return r;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1210
}
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1211
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1212
#else
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1213
# define _DeleteObject(o,lnr)  DeleteObject(o)
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1214
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1215
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1216
static void
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  1217
_DeleteFont(HFONT f, int lineNr)
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1218
{
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1219
#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
  1220
    if (f == __tmpDC_hfont) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1221
	SelectObject(__tmpDC, __tmpDC_prev_hfont);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1222
	__tmpDC_hfont = NULL;
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1223
    }
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1224
#endif
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1225
    _DeleteObject(f, lineNr);
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1226
}
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
  1227
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1228
static int
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  1229
_DeleteBrush(HBRUSH br, int lineNr)
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1230
{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1231
    if ((br != __whiteBrush) && (br != __blackBrush)) {
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1232
	int r = DeleteObject(br);
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1233
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1234
	if (r == 0)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1235
	    console_fprintf(stderr, "WinWorkstation [warning]: ERROR in DeleteBrush %x [%d]\n", br, lineNr);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1236
	return r;
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1237
    }
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1238
    return 1;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1239
}
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1240
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1241
static int
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  1242
_DeletePen(HPEN p, int lineNr)
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1243
{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1244
    if ((p != __whitePen) && (p != __blackPen)) {
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1245
	int r = DeleteObject(p);
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1246
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1247
	if (r == 0)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1248
	    console_fprintf(stderr, "WinWorkstation [warning]: ERROR in DeletePen %x [%d]\n", p, lineNr);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1249
	return r;
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1250
    }
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1251
    return 1;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1252
}
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  1253
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1254
#ifdef CACHE_PEN
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1255
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1256
static int
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  1257
_DeletePenIfNotInCache(HPEN p, int lineNr)
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1258
{
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1259
    int i, r;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1260
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1261
    if ((p == __whitePen) || (p == __blackPen)) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1262
	return 1; /* not deleted, but OK */
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1263
    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  1264
    for (i=0; i<NUM_PEN_CACHED;i++) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1265
	if (__penCache[i].pen == p) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1266
	    return 1; /* not deleted, but OK */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1267
	}
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  1268
    }
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1269
    r = DeleteObject(p);
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1270
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1271
    if (r == 0)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1272
	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
  1273
    return r;
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1274
}
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1275
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1276
#else
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1277
# define _DeletePenIfNotInCache(p, lineNr)   _DeletePen(p, lineNr)
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1278
#endif /* CACHE_PEN */
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1279
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1280
#ifdef CACHE_BRUSH
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1281
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1282
static int
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  1283
_DeleteBrushIfNotInCache(HBRUSH br, int lineNr)
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1284
{
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1285
    int i, r;
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1286
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  1287
    for (i=0; i<NUM_BRUSH_CACHED;i++) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1288
	if (__brushCache[i].brush == br) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1289
	    return 1; /* not deleted, but OK */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1290
	}
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  1291
    }
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1292
    if ((br == __whiteBrush) || (br == __blackBrush)) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1293
	return 1; /* not deleted, but OK */
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1294
    }
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
  1295
    r = DeleteObject(br);
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1296
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1297
    if (r == 0)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1298
	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
  1299
    return r;
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1300
}
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1301
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1302
#else
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
  1303
# define _DeleteBrushIfNotInCache(br, lineNr)   _DeleteBrush(br, lineNr)
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1304
#endif /* CACHE_BRUSH */
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1305
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1306
static struct gcData *
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
  1307
newGcData(void)
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1308
{
5575
Stefan Vogel <sv@exept.de>
parents: 5574
diff changeset
  1309
    struct gcData *gcData;
Stefan Vogel <sv@exept.de>
parents: 5574
diff changeset
  1310
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1311
    if (gcDataFreeList) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1312
	gcData = gcDataFreeList;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1313
	gcDataFreeList = gcData->u.__nextFree;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1314
	gcDataNumFree--;
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1315
    } else {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1316
	gcData = (struct gcData *) malloc(sizeof(struct gcData));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1317
	if (! gcData) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1318
	    console_fprintf(stderr, "WinWorkstat [warning]: failed to allocate gcData\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1319
	    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1320
	}
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1321
    }
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1322
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1323
    memset(gcData, 0, sizeof(struct gcData));
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  1324
    gcData->fgColor = 0xffffff;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1325
    /* gcData->bgColor = 0; - not needed - memset does it */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1326
    gcData->clipping = FALSE;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1327
    gcData->clipByChildren = TRUE;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1328
    gcData->bitbltrop2 = BITBLT_COPY;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1329
    gcData->lineWidth = 1;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1330
    gcData->lStyle = PS_SOLID | PS_JOIN_MITER | PS_ENDCAP_FLAT;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1331
    /* 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
  1332
    /* 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
  1333
    /* gcData->hBrush = 0; - not needed - memset does it */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1334
    return gcData;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1335
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1336
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1337
static void
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1338
freeGcData(struct gcData *gcData)
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1339
{
2754
21cbbc8fbe09 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2752
diff changeset
  1340
    if (gcDataNumFree < NUM_FREE_GC) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1341
	gcData->u.__nextFree = gcDataFreeList;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1342
	gcDataFreeList = gcData;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1343
	gcDataNumFree++;
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1344
    } else {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1345
	free(gcData);
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1346
    }
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1347
}
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  1348
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1349
#ifdef CACHE_LAST_DC
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1350
# 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
  1351
    if (lastGcData == __gcData__) {  \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1352
	_releaseDC(lastGcData);      \
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1353
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1354
#else
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1355
# 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
  1356
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1357
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1358
#ifdef CACHE_LAST_PEN
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1359
# 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
  1360
    if (__gcData__->hPen) {           \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1361
	if (__gcData__->save_hPen) {  \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1362
	    SelectObject(__gcData__->_hDC, __gcData__->save_hPen); \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1363
	    __gcData__->save_hPen = 0;   \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1364
	} \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1365
	_DeletePenIfNotInCache(__gcData__->hPen, __LINE__); \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1366
	__gcData__->hPen = 0; \
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1367
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1368
#else
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1369
# 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
  1370
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1371
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1372
#ifdef CACHE_LAST_BRUSH
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1373
# 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
  1374
    if (__gcData__->hBrush) {           \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1375
	if (__gcData__->save_hBrush) {  \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1376
	    SelectObject(__gcData__->_hDC, __gcData__->save_hBrush); \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1377
	    __gcData__->save_hBrush = 0;   \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1378
	} \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1379
	_DeleteBrushIfNotInCache(__gcData__->hBrush, __LINE__); \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1380
	__gcData__->hBrush = 0; \
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1381
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1382
#else
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1383
# 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
  1384
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1385
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1386
static void
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1387
_releaseDC(struct gcData *gcData)
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1388
{
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1389
    HDC hDC = gcData->_hDC;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1390
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1391
    if (gcData->doNotCacheOrRelease ) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1392
	return;
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1393
    }
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1394
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1395
    if (gcData->save_hPen) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1396
	SelectObject(hDC, gcData->save_hPen);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1397
	gcData->save_hPen = 0;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1398
    }
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1399
    if (gcData->save_hBrush) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1400
	SelectObject(hDC, gcData->save_hBrush);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1401
	gcData->save_hBrush = 0;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1402
    }
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1403
    if (gcData->save_hFont) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1404
	SelectObject(hDC, gcData->save_hFont);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1405
	gcData->save_hFont = 0;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1406
    }
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1407
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1408
    if (gcData->hWnd) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1409
	if (hDC) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1410
	    ReleaseDC(gcData->hWnd, hDC);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1411
#ifdef CACHE_LAST_WM_PAINT_DC
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1412
	    if (hDC == last_wm_paint_dc) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1413
		last_wm_paint_dc = last_wm_paint_win = 0;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  1414
# ifdef DEBUG_DC_REUSE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1415
		console_fprintf(stderr, "WinWorkstation [info]: Oops - releasing bg_paint-dc\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1416
# endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1417
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1418
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1419
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1420
    } else if (gcData->hBitmap) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1421
	SelectObject(hDC, gcData->save_hBitmap);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1422
	DeleteDC(hDC);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1423
    }
2383
9a5be0903b57 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2378
diff changeset
  1424
    gcData->_hDC = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1425
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1426
#ifdef CACHE_LAST_DC
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1427
    if (lastGcData == gcData) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1428
	lastGcData = 0;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1429
    }
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1430
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1431
#ifdef CACHE_LAST_PEN
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1432
    if (gcData->hPen) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1433
	_DeletePenIfNotInCache(gcData->hPen, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1434
	gcData->hPen = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1435
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1436
#endif
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1437
#ifdef CACHE_LAST_BRUSH
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1438
    if (gcData->hBrush) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1439
	_DeleteBrushIfNotInCache(gcData->hBrush, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1440
	gcData->hBrush = 0;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1441
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1442
#endif
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1443
}
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1444
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1445
static HDC
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1446
_getDC(struct gcData *gcData)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1447
{
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1448
    HDC hDC;
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1449
    int currThreadId;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1450
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1451
    if (gcData->doNotCacheOrRelease ) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1452
	return gcData->_hDC;
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1453
    }
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1454
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1455
#ifdef CACHE_LAST_DC
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1456
    currThreadId = GetCurrentThreadId();
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  1457
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1458
    if (lastGcData) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1459
	if ((lastGcData == gcData)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1460
	 && (lastGcHWIN == gcData->hWnd)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1461
	 && (lastGcHBITMAP == gcData->hBitmap)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1462
	 && (lastGcOwnerThreadID == currThreadId)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1463
	 && gcData->_hDC
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1464
	) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1465
# ifdef CACHE_LAST_WM_PAINT_DC /* DDD */
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1466
	    if (last_wm_paint_dc == gcData->_hDC) {
2732
bb3d3b26a81c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2728
diff changeset
  1467
#  ifdef DEBUG_DC_REUSE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1468
		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
  1469
#  endif
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1470
		last_wm_paint_dc = last_wm_paint_win = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1471
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1472
# endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1473
	    return gcData->_hDC;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1474
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1475
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1476
	_releaseDC(lastGcData);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1477
	lastGcData = 0;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1478
    }
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
  1479
#endif
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1480
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1481
    hDC = 0;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1482
    if (gcData->hWnd != 0) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1483
	if (gcData->hWnd == __rootWin) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1484
	    hDC = gcData->_hDC = GetDCEx(gcData->hWnd, 0, DCX_WINDOW);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1485
	} else if (gcData->clipByChildren) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1486
	    //gcData->_hDC = GetDCEx(gcData->hWnd, 0, DCX_CLIPCHILDREN);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1487
	    hDC = gcData->_hDC = GetDC(gcData->hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1488
	} else  {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1489
	    hDC = gcData->_hDC = GetDCEx(gcData->hWnd, 0, DCX_PARENTCLIP);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1490
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1491
    } else if (gcData->hBitmap) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1492
	hDC = gcData->_hDC = CreateCompatibleDC(__tmpDC);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1493
	gcData->save_hBitmap = SelectObject(gcData->_hDC,gcData->hBitmap);
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1494
    }
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1495
    gcData->bkMode = BK_UNDEF;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1496
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1497
    if (hDC) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1498
	SetTextColor(hDC, gcData->fgColor);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1499
	SetBkColor(hDC, gcData->bgColor);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1500
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1501
	if (gcData->rop2)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1502
	    SetROP2(hDC, gcData->rop2);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1503
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1504
	if (gcData->clipping) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1505
	    HRGN region = CreateRectRgn( gcData->clipX, gcData->clipY,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1506
					 gcData->clipX + gcData->clipW,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1507
					 gcData->clipY + gcData->clipH);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1508
	    if (region == NULL ) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1509
		console_fprintf(stderr, "WinWorkstat [warning]: clipping region creation failed\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1510
	    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1511
		if (SelectClipRgn(hDC, region) == ERROR ) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1512
		    DPRINTF(("WinWorkstat [warning]: select clipping region failed\n" ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1513
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1514
		_DeleteObject(region, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1515
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1516
	} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1517
	    SelectClipRgn(hDC, NULL);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1518
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1519
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1520
	if (gcData->hFont) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1521
	    HFONT prevFont;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1522
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1523
	    prevFont = SelectObject(hDC, gcData->hFont);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1524
	    if (! gcData->save_hFont) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1525
		gcData->save_hFont = prevFont;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1526
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1527
	}
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1528
    }
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1529
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1530
#ifdef CACHE_LAST_DC
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1531
    lastGcData = gcData;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  1532
    lastGcOwnerThreadID = currThreadId;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1533
    lastGcHWIN = gcData->hWnd;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1534
    lastGcHBITMAP = gcData->hBitmap;
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  1535
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  1536
    gcData->_hDC = hDC;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1537
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1538
# ifdef CACHE_LAST_WM_PAINT_DC /* DDD */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1539
    if (last_wm_paint_dc == hDC) {
2732
bb3d3b26a81c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2728
diff changeset
  1540
#  ifdef DEBUG_DC_REUSE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1541
	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
  1542
#  endif
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1543
	last_wm_paint_dc = last_wm_paint_win = 0;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1544
    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1545
# endif
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1546
#endif
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  1547
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
  1548
    return hDC;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1549
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1550
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1551
static HBRUSH
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1552
GcDataGetBrush(HDC hDC, struct gcData *gcData)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1553
{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1554
    HBRUSH hBrush = 0;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1555
    HBRUSH prevBrush;
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1556
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1557
#ifdef CACHE_LAST_BRUSH
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1558
    if (hBrush = gcData->hBrush) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1559
	if (! gcData->save_hBrush) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1560
	    gcData->save_hBrush = SelectObject(gcData->_hDC, hBrush);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1561
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1562
	return hBrush;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1563
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1564
#endif
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1565
    if (gcData->hMask) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1566
	hBrush = CreatePatternBrush(gcData->hMask);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1567
	SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1568
	RESPRINTF(("CreatePatternBrush %x\n",gcData->hMask));
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
  1569
    } else {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1570
	if (gcData->fgColor == BlackPixel) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1571
	    hBrush = __blackBrush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1572
	} else if (gcData->fgColor == WhitePixel) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1573
	    hBrush = __whiteBrush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1574
	} else {
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1575
#ifdef CACHE_BRUSH
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1576
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1577
		int i;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1578
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1579
		for (i=0; i<NUM_BRUSH_CACHED; i++) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1580
		    if (__brushCache[i].clr == gcData->fgColor) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1581
			hBrush = __brushCache[i].brush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1582
			/*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1583
			 * move it up in the cache
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1584
			 */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1585
			if (i > 0) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1586
			    HBRUSH t = __brushCache[i-1].brush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1587
			    int c = __brushCache[i-1].clr;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1588
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1589
			    __brushCache[i-1].brush = hBrush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1590
			    __brushCache[i-1].clr = gcData->fgColor;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1591
			    __brushCache[i].brush = t;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1592
			    __brushCache[i].clr = c;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1593
			}
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1594
# ifdef CACHE_LAST_BRUSH
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1595
			prevBrush = SelectObject(gcData->_hDC, hBrush);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1596
			if (! gcData->save_hBrush) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1597
			    gcData->save_hBrush = prevBrush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1598
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1599
			gcData->hBrush = hBrush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1600
# endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1601
			return hBrush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1602
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1603
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1604
	    }
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1605
#endif /* BRUSH_CACHE */
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1606
	    hBrush = CreateSolidBrush(gcData->fgColor);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1607
	    RESPRINTF(("CreateSolidBrush %x\n",gcData->fgColor));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1608
	}
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1609
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1610
    gcData->hBrush = hBrush;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1611
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1612
    prevBrush = SelectObject(gcData->_hDC, hBrush);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1613
    if (! gcData->save_hBrush) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1614
	gcData->save_hBrush = prevBrush;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1615
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1616
    return hBrush;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1617
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1618
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1619
#ifdef CACHE_LAST_BRUSH
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1620
# define GcDataReleaseBrush(hDC, gcData)  /* nothing*/
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1621
#else
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1622
static void
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1623
GcDataReleaseBrush(HDC hDC, struct gcData *gcData)
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1624
{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1625
    HBRUSH hBrush = gcData->hBrush;
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1626
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1627
    if (gcData->save_hBrush) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1628
	SelectObject(hDC, gcData->save_hBrush);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1629
	gcData->save_hBrush = NULL;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1630
    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  1631
    _DeleteBrushIfNotInCache(hBrush, __LINE__);
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1632
    gcData->hBrush = 0;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1633
}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1634
#endif
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1635
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1636
static HPEN
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1637
GcDataGetPen(HDC hDC, struct gcData *gcData)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1638
{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1639
    HPEN hPen = 0;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1640
    HPEN prevPen;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1641
    LOGBRUSH Brush;
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  1642
    int lw;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1643
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1644
#ifdef CACHE_LAST_PEN
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1645
    if (hPen = gcData->hPen) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1646
	if (! gcData->save_hPen) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1647
	    gcData->save_hPen = SelectObject(gcData->_hDC, hPen);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1648
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1649
	return hPen;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1650
    }
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1651
#endif
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1652
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1653
    if (((gcData->lStyle & PS_STYLE_MASK) == PS_SOLID)
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1654
     && (gcData->hMask == 0)
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1655
     && (gcData->lineWidth <= 1)) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1656
	if (gcData->fgColor == BlackPixel) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1657
	    gcData->hPen = hPen = __blackPen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1658
	    prevPen = SelectObject(hDC, hPen);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1659
	    if (! gcData->save_hPen) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1660
		gcData->save_hPen = prevPen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1661
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1662
	    return hPen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1663
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1664
	if (gcData->fgColor == WhitePixel) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1665
	    gcData->hPen = hPen = __whitePen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1666
	    prevPen = SelectObject(hDC, hPen);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1667
	    if (! gcData->save_hPen) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1668
		gcData->save_hPen = prevPen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1669
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1670
	    return hPen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1671
	}
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1672
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1673
#ifdef CACHE_PEN
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1674
	{
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1675
	    int i;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1676
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1677
	    for (i=0; i<NUM_PEN_CACHED; i++) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1678
		if (__penCache[i].clr == gcData->fgColor) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1679
		    hPen = __penCache[i].pen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1680
		    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1681
		     * move it up in the cache
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1682
		     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1683
		    if (i > 0) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1684
			HPEN t = __penCache[i-1].pen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1685
			int c = __penCache[i-1].clr;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1686
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1687
			__penCache[i-1].pen = hPen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1688
			__penCache[i-1].clr = gcData->fgColor;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1689
			__penCache[i].pen = t;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1690
			__penCache[i].clr = c;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1691
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1692
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1693
		    gcData->hPen = hPen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1694
		    prevPen = SelectObject(hDC, hPen);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1695
		    if (! gcData->save_hPen) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1696
			gcData->save_hPen = prevPen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1697
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1698
		    return hPen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1699
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1700
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1701
	}
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
  1702
#endif /* PEN_CACHE */
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1703
    }
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1704
4149
663c31c90a53 optimize displayLine: and define CACHE_LAST_DC
ca
parents: 4145
diff changeset
  1705
    hPen = (HPEN) 0;
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  1706
    lw = gcData->lineWidth;
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  1707
    if (lw == 0) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1708
	lw = 1;
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  1709
    }
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  1710
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  1711
    /*
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  1712
     * NT supports masked drawing with any lineStyle,
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  1713
     * and also non-solid lines with any lineWidth.
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  1714
     */
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  1715
    if (gcData->hMask) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1716
	Brush.lbStyle = BS_PATTERN;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1717
	Brush.lbHatch = (ULONG_PTR)(gcData->hMask);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1718
	Brush.lbColor = gcData->fgColor;
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  1719
    } else {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1720
	Brush.lbStyle = BS_SOLID;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1721
	Brush.lbHatch = (ULONG_PTR)0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1722
	Brush.lbColor = gcData->fgColor;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1723
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1724
	hPen = (HPEN) 0;
5661
52da326a0fe1 use ExtCreatePen not CreatePen search for: USE_OLD_CREATE_PEN
ca
parents: 5660
diff changeset
  1725
52da326a0fe1 use ExtCreatePen not CreatePen search for: USE_OLD_CREATE_PEN
ca
parents: 5660
diff changeset
  1726
#if USE_OLD_CREATE_PEN
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1727
	hPen = CreatePen((gcData->lStyle & PS_STYLE_MASK), lw, gcData->fgColor);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1728
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1729
	RESPRINTF(("CreatePen %x %d(%d) %x %x\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1730
		    gcData->lStyle,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1731
		    lw, gcData->lineWidth,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1732
		    gcData->fgColor, gcData->hMask));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1733
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1734
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1735
	SetBkMode(hDC, TRANSPARENT);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1736
	gcData->bkMode = BK_TRANSPARENT;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1737
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1738
	if (! hPen) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1739
	    hPen = ExtCreatePen(PS_GEOMETRIC | gcData->lStyle,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1740
			    lw, /* gcData->lineWidth, */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1741
			    &Brush,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1742
			    0, 0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1743
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1744
	    RESPRINTF(("ExtCreatePen1 %x %d(%d) %x %x\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1745
			gcData->lStyle,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1746
			lw, gcData->lineWidth,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1747
			gcData->fgColor, gcData->hMask));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1748
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1749
	    if (gcData->hMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1750
		SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1751
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1752
	}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1753
    }
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1754
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1755
    gcData->hPen = hPen;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1756
    prevPen = SelectObject(hDC, hPen);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1757
    if (! gcData->save_hPen) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1758
	gcData->save_hPen = prevPen;
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1759
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  1760
3573
d5e57dbb0dcb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3571
diff changeset
  1761
#ifdef CACHE_PEN
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1762
    /*
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1763
     * remember in penCache
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1764
     */
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1765
    if (((gcData->lStyle & PS_STYLE_MASK) == PS_SOLID)
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1766
     && (gcData->hMask == 0)
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1767
     && (gcData->lineWidth <= 1)) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1768
	int i;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1769
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1770
	/*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1771
	 * search for an empty slot
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1772
	 */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1773
	for (i=0; i<NUM_PEN_CACHED; i++) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1774
	    if (__penCache[i].pen == 0) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1775
		__penCache[i].clr = gcData->fgColor;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1776
		__penCache[i].pen = hPen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1777
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1778
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1779
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1780
	if (i == NUM_PEN_CACHED) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1781
	    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1782
	     * replace last in penCache
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1783
	     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1784
	    HPEN t = __penCache[NUM_PEN_CACHED - 1].pen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1785
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1786
	    __penCache[NUM_PEN_CACHED - 1].pen = hPen;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1787
	    __penCache[NUM_PEN_CACHED - 1].clr = gcData->fgColor;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1788
	    _DeletePen(t, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1789
	}
2666
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1790
    }
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1791
#endif
95aea895f5b1 more pen caching
Claus Gittinger <cg@exept.de>
parents: 2665
diff changeset
  1792
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  1793
    return hPen;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1794
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  1795
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1796
#ifdef CACHE_LAST_PEN
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1797
# define GcDataReleasePen(HDC hDC, struct gcData *gcData)  /* nothing*/
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1798
#else
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1799
static void
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1800
GcDataReleasePen(HDC hDC, struct gcData *gcData)
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1801
{
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1802
    HPEN hPen;
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1803
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  1804
    if (gcData->save_hPen) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1805
	SelectObject(hDC, gcData->save_hPen);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1806
	gcData->save_hPen = NULL;
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1807
    }
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  1808
    hPen = gcData->hPen;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  1809
    _DeletePenIfNotInCache(hPen, __LINE__);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1810
    gcData->hPen = 0;
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1811
}
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1812
#endif /* CACHE_LAST_PEN */
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
  1813
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1814
/* atze */
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1815
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1816
static int
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  1817
lockEvents(char *whoIsLocking)
4367
0486a7345d7f *** empty log message ***
penk
parents: 4366
diff changeset
  1818
{
4504
0f0a6f7fabd5 lockEvent bug (workaround ?)
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1819
    DWORD dwWaitResult = WaitForSingleObject(hEventsMutex, 5000L);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1820
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1821
#ifdef LOCK_DEBUG
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1822
    lockCountEvents++;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1823
    if (lockCountEvents != 1) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1824
	console_fprintf(stderr, "WinWorkstation [warning]: lockCountEvents (%d) != 1 in lock\n", lockCountEvents);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1825
	lockCountEvents = 1;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1826
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1827
#endif
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1828
4504
0f0a6f7fabd5 lockEvent bug (workaround ?)
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1829
    switch (dwWaitResult) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1830
	case WAIT_OBJECT_0:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1831
	    hEventsMutexOwner = whoIsLocking;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1832
	    return (TRUE);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1833
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1834
	case WAIT_ABANDONED:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1835
	    console_fprintf(stderr, "WinWorkstation [warning]: lockEvent abandoned (was owned by %s)\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1836
			(hEventsMutexOwner ? hEventsMutexOwner : "NONE"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1837
	    hEventsMutexOwner = whoIsLocking;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1838
	    return (TRUE);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1839
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1840
	case WAIT_TIMEOUT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1841
	    console_fprintf(stderr, "WinWorkstation [warning]: lockEvent timeout (owned by %s)\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1842
			(hEventsMutexOwner ? hEventsMutexOwner : "NONE") );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1843
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1844
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1845
	default:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1846
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1847
		unsigned errCode = GetLastError();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1848
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1849
		console_fprintf(stderr, "WinWorkstation [error]: lockEvent error (owned by %s) rslt=0x%x err=0x%x\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1850
			    (hEventsMutexOwner ? hEventsMutexOwner : "NONE"),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1851
			    dwWaitResult, errCode );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1852
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1853
	    break;
4504
0f0a6f7fabd5 lockEvent bug (workaround ?)
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1854
    }
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1855
    return (FALSE);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1856
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1857
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1858
static int
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1859
unlockEvents(void) {
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1860
#ifdef LOCK_DEBUG
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1861
    lockCountEvents--;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1862
    if (lockCountEvents != 0) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1863
	console_fprintf(stderr, "WinWorkstation [warning]: lockCountEvents (%d) != 0 in unlock\n", lockCountEvents);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1864
	lockCountEvents = 0;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1865
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1866
#endif
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1867
    if (! ReleaseMutex(hEventsMutex)) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  1868
       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
  1869
       return (FALSE);
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1870
    }
4504
0f0a6f7fabd5 lockEvent bug (workaround ?)
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  1871
    hEventsMutexOwner = NULL;
4367
0486a7345d7f *** empty log message ***
penk
parents: 4366
diff changeset
  1872
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1873
    return (TRUE);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1874
}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1875
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1876
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1877
static int
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  1878
initEventqueue(void) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1879
    struct queuedEvent *bulk;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1880
    int i;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1881
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1882
    bulk = (struct queuedEvent *) malloc(EV_CHUNK_SZ);
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1883
    if (bulk == 0) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1884
	console_fprintf(stderr, "WinWorkstation [warning]: no memory for dispatchqueue\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1885
	return 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1886
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1887
    for (i=1; i<EV_CHUNK_CNT; i++) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1888
	bulk[i-1].ev_next = &(bulk[i]);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1889
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1890
    bulk[EV_CHUNK_CNT-1].ev_next = (struct queuedEvent *)0;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1891
    eventFreeList = bulk;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1892
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1893
    return 1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1894
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1895
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  1896
#define EV_NOTIME       0
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  1897
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1898
#define enqEvent(a1, a2, a3, a4, a5, a6, a7, a8, a9) \
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1899
    __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
  1900
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  1901
static void
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1902
__enqEvent(int flag, HWND hWnd, UINT message, UINT wParam, INT arg1, INT arg2, INT arg3, INT arg4, UINT evTime)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1903
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1904
    struct queuedEvent *ev = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  1905
    int repeatCount = 0;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1906
4445
c83f9aebaf41 comment
Claus Gittinger <cg@exept.de>
parents: 4444
diff changeset
  1907
    /* get an event struct
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1908
    */
4445
c83f9aebaf41 comment
Claus Gittinger <cg@exept.de>
parents: 4444
diff changeset
  1909
    while (! eventFreeList) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1910
	if (repeatCount++ >= 5) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1911
	    /* throw away sorry */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1912
	    console_fprintf(stderr, "WinWorkstation [error]: event throw away (memory problem)\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1913
	    return;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1914
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1915
	console_fprintf(stderr, "WinWorkstation [warning]: wait for event memory (%d)\n", repeatCount);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1916
	WaitForSingleObject( hNeverTriggered, 100L );
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1917
    }
4367
0486a7345d7f *** empty log message ***
penk
parents: 4366
diff changeset
  1918
    if (! lockEvents("enqEvent")) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1919
	console_fprintf(stderr, "WinWorkstation [error]: event throw away (lock problem)\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1920
	return;
4363
d7a017ae1487 *** empty log message ***
penk
parents: 4353
diff changeset
  1921
    }
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1922
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1923
    ev = eventFreeList;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1924
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1925
    if (! ev) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1926
	console_fprintf(stderr, "WinWorkstation [error]: event throw away (memory problem)\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1927
	unlockEvents();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1928
	return;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1929
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1930
    eventFreeList  = ev->ev_next;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1931
    ev->ev_flag    = flag;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1932
    ev->ev_hWnd    = hWnd;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1933
    ev->ev_message = message;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1934
    ev->ev_wParam  = wParam;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1935
    ev->ev_arg1    = arg1;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1936
    ev->ev_arg2    = arg2;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1937
    ev->ev_arg3    = arg3;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1938
    ev->ev_arg4    = arg4;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1939
    ev->ev_time    = evTime /* lastMSGTime */;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1940
    ev->count      = eventsendcount++;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1941
    ev->ev_next    = (struct queuedEvent *) 0;
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1942
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1943
    if (eventQueueTail) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1944
	eventQueueTail->ev_next = ev;
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1945
    } else {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1946
	eventQueueHead = ev;
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1947
    }
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  1948
    eventQueueTail = ev;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  1949
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1950
    unlockEvents();
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1951
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1952
    if (eventQueueHead == ev) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1953
	SetEvent(hInputEvent);
2614
0e43d058c264 manage some eventQ entries (free/alloc) without a need
Claus Gittinger <cg@exept.de>
parents: 2610
diff changeset
  1954
    }
2511
5795501d41cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2508
diff changeset
  1955
2337
79f957096b99 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2336
diff changeset
  1956
#if 0
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  1957
    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
  1958
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1959
}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  1960
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1961
static int
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1962
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
  1963
{
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1964
    struct queuedEvent * ev = NULL;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1965
    char * freeArg2 = NULL;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1966
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1967
    if (mask != ~0) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1968
	PRINTF(("deqEvent mask:%x\n",mask));
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1969
    }
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1970
    if (hWnd) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1971
	PRINTF(("deqEvent hWnd:%x\n",hWnd));
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  1972
    }
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  1973
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1974
  again:
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1975
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1976
    if (! eventQueueHead)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1977
	return (0);
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1978
4367
0486a7345d7f *** empty log message ***
penk
parents: 4366
diff changeset
  1979
    if (! lockEvents("deqEvent")) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1980
	return (0);
4363
d7a017ae1487 *** empty log message ***
penk
parents: 4353
diff changeset
  1981
    }
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1982
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1983
    TH_DPRINTF(("TDEQ\n"));
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1984
    ev = eventQueueHead;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1985
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1986
    if (! ev) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1987
	unlockEvents();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1988
	return (0);
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
    eventQueueHead = ev->ev_next;
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 (! eventQueueHead) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1993
	eventQueueTail = (struct queuedEvent *) 0;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1994
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1995
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  1996
    if (ev->count != -1) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1997
	static int anyGoodEventReceived = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1998
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  1999
	if (eventempfcount != ev->count) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2000
	    if (anyGoodEventReceived) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2001
		console_fprintf(stderr, "WinWorkstation [warning]: lost event (eventcount error %d <-> %d)\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2002
				 eventempfcount, ev->count);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2003
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2004
	    eventempfcount = ev->count;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2005
	    anyGoodEventReceived = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2006
	} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2007
	    anyGoodEventReceived = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2008
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2009
	eventempfcount++;
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2010
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2011
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2012
    if (ev->ev_message == WM_DESTROY) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2013
	/*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2014
	 * arg2 is the localInfoPtr
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2015
	 * (which is already cleared in the wind-structure)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2016
	 * it must be freed by the stx-process ('cause it was malloc'd by it)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2017
	 */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2018
	if (ev->ev_arg2) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2019
	    freeArg2 = (char *) ev->ev_arg2;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2020
	    ev->ev_arg2 = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2021
	}
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  2022
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  2023
#ifdef TOPWINDOWCLASS
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2024
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2025
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
  2026
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2027
	if (ev->ev_arg1) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2028
	    if (UnregisterClass((char*)ev->ev_arg1,(HANDLE) __getHInstance())) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2029
		/*console_printf("UnregisterClass %s ok.\n",(char*)ev->ev_arg1);*/
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2030
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2031
	    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2032
		/* noch einmal in die queue
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2033
		*/
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2034
		if (ev->ev_arg2++ < 100) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2035
		    ev->ev_next = (struct queuedEvent *)0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2036
		    ev->count   = eventsendcount++;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2037
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2038
		    if (eventQueueTail) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2039
			eventQueueTail->ev_next = ev;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2040
		    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2041
			eventQueueHead = ev;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2042
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2043
		    eventQueueTail = ev;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2044
		    unlockEvents();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2045
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2046
		    if (freeArg2) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2047
			free (freeArg2);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2048
			freeArg2 = NULL;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2049
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2050
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2051
		    if (ev->ev_arg2 > 98) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2052
			console_fprintf(stderr, "WinWorkstation [info]: UnregisterClass %s failed. Wait 1 sec.\n",(char*)ev->ev_arg1);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2053
			sleep(1);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2054
		    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2055
			sleep(0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2056
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2057
		    goto again;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2058
		}
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
  2059
		/* fail evtl. später ändern und in st verzögert aufrufen
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2060
		*/
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2061
		console_fprintf(stderr, "WinWorkstation [info]: UnregisterClass %s failed.\n",(char*)ev->ev_arg1);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2062
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2063
	    free((char*)ev->ev_arg1);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2064
	    ev->ev_arg1 = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2065
	}
4154
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2066
#endif
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2067
    }
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2068
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2069
    *ret_ev = *ev;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2070
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2071
    ev->ev_next   = eventFreeList;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2072
    eventFreeList = ev;
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2073
    unlockEvents();
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2074
662732d0c60a using one lock instead of two locks for event exchange
ca
parents: 4149
diff changeset
  2075
    if (freeArg2) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2076
	free (freeArg2);
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
    return (1);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2079
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2080
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2081
static void
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2082
__clearRectangles(HWND hWnd, int numRects, RECT *pRect)
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2083
{
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2084
	HDC dc;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2085
	HBRUSH br;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2086
	int bgClr;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2087
	int isPrivateBrush = 0;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2088
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2089
# ifdef CACHE_LAST_WM_PAINT_DC
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2090
	AQUIRE_PAINT_MUTEX;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2091
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2092
	if (last_wm_paint_dc && (last_wm_paint_win == hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2093
	    dc = last_wm_paint_dc;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2094
	} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2095
	    if (last_wm_paint_dc) {
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2096
#  ifdef CACHE_LAST_DC
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2097
		if (lastGcData && (lastGcData->_hDC == last_wm_paint_dc)) {
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2098
#   ifdef DEBUG_DC_REUSE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2099
		    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
  2100
#   endif
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2101
		    _releaseDC(lastGcData);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2102
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2103
		    ReleaseDC(last_wm_paint_win, last_wm_paint_dc);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2104
		}
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2105
#  else
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2106
		ReleaseDC(last_wm_paint_win, last_wm_paint_dc);
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  2107
#  endif /* CACHE_LAST_DC */
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2108
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2109
	    dc = GetDC(hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2110
	    last_wm_paint_dc = dc;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2111
	    last_wm_paint_win = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2112
	}
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2113
# else
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2114
	dc = (HDC)GetDC(hWnd);
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  2115
# endif /* CACHE_LAST_WM_PAINT_DC */
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2116
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2117
# ifdef CACHE_LAST_DC
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2118
	if (lastGcData && (lastGcData->_hDC == dc)) {
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2119
#  ifdef DEBUG_DC_REUSE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2120
	    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
  2121
#  endif
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2122
	    if ((lastGcData->rop2 != R2_COPYPEN)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2123
	     || (lastGcData->bitbltrop2 != BITBLT_COPY)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2124
		console_fprintf(stderr, "WinWorkstation [info]: Oops wm_paint_dc not in Copy mode\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2125
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2126
	    lastGcData = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2127
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2128
# endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2129
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2130
	br = GetWindow_viewBgBrush(hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2131
	if (! br) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2132
	    bgClr = GetWindow_viewBgColor(hWnd);
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2133
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2134
# ifdef CACHE_LAST_WM_PAINT_BRUSH
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2135
	    if (last_wm_paint_brush
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2136
	     && (last_wm_paint_brush_clr == bgClr)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2137
		br = last_wm_paint_brush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2138
	    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2139
		if (bgClr == WhitePixel) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2140
		    br = __whiteBrush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2141
		} else if (bgClr == BlackPixel) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2142
		    br = __blackBrush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2143
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2144
		    if (last_wm_paint_brush) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2145
			_DeleteBrush(last_wm_paint_brush, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2146
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2147
		    last_wm_paint_brush = br = CreateSolidBrush(bgClr);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2148
		    last_wm_paint_brush_clr = bgClr;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2149
		    isPrivateBrush = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2150
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2151
	    }
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2152
# else
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2153
	    br = CreateSolidBrush(bgClr);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2154
	    isPrivateBrush = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2155
# endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2156
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2157
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2158
	if (! br) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2159
	    console_fprintf(stderr, "WinWorkstation [info]: no brush\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2160
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2161
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2162
	if (br) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2163
	    int i;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2164
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2165
	    SelectClipRgn(dc, NULL);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2166
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2167
	    for (i=0; i<numRects; i++) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2168
		/*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2169
		 * always clear - even if not interested in exposes
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2170
		 */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2171
		FillRect(dc, &(pRect[i]), br);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2172
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2173
	}
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2174
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2175
# ifndef CACHE_LAST_WM_PAINT_BRUSH
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2176
	if (isPrivateBrush) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2177
	    _DeleteBrush(br, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2178
	}
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2179
# endif
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2180
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2181
# ifndef CACHE_LAST_WM_PAINT_DC
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2182
	ReleaseDC(hWnd, dc);
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2183
# endif
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2184
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
  2185
# if defined(CACHE_LAST_WM_PAINT_DC)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2186
	RELEASE_PAINT_MUTEX
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2187
# endif
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2188
}
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2189
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2190
static void
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2191
__clearWindow(HWND hWnd, int x, int y, int w, int h)
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2192
{
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2193
	RECT rect;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2194
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2195
	rect.left = x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2196
	rect.top = y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2197
	rect.right = x + w;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2198
	rect.bottom = y + h;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2199
	__clearRectangles(hWnd, 1, &rect);
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2200
}
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2201
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2202
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2203
/*
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2204
 * 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
  2205
 * return the number of events (>0), if any was generated.
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2206
 * 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
  2207
 * if a region is passed in, it is not destroyed.
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  2208
 */
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2209
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2210
static int
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2211
__generateExposes(HWND hWnd, HRGN hRgnInOrNull, int msgType, int doClear)
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2212
{
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2213
	RECT updRect;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2214
	HRGN updRgn = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2215
	int numRects, ret, n, i;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2216
	int wantExpose;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2217
	RECT *pRect;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2218
	union {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2219
	    RGNDATA rgnData;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2220
	    char    bytes[512];
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2221
	} data;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2222
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2223
	wantExpose = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2224
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2225
	if( msgType >= 0 )
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2226
	    wantExpose = (GetWindow_eventMask(hWnd) & ExposureMask);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2227
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2228
	if (hRgnInOrNull) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2229
	    updRgn = hRgnInOrNull;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2230
	} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2231
	    PAINTSTRUCT ps;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2232
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2233
	    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2234
	     * fetch the update region, even if ExposureMask is empty.
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2235
	     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2236
	    updRgn = CreateRectRgn(0, 0, 0, 0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2237
	    ret = GetUpdateRgn(hWnd, updRgn, FALSE);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2238
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2239
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2240
	    BeginPaint(hWnd, &ps);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2241
	    /* store the rectangle required for image bit reversal */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2242
	    /* updateRect = ps.rcPaint;   */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2243
	    EndPaint(hWnd, &ps);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2244
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2245
	    switch (ret) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2246
		case ERROR:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2247
		    console_fprintf(stderr, "WinWorkstation [info]: errregion\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2248
		    return -1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2249
		case NULLREGION:
6165
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2250
		    DDDDPRINTF(("nullregion\n"));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2251
		    _DeleteObject(updRgn, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2252
		    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2253
		case SIMPLEREGION:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2254
		case COMPLEXREGION:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2255
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2256
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2257
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2258
	n = GetRegionData(updRgn, sizeof(data), &(data.rgnData));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2259
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2260
	/*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2261
	 * the MS-doc states: n==1
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2262
	 * but this is not true
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2263
	 */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2264
	if ((n >= sizeof(RGNDATA))
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2265
	 && (n <= sizeof(data))
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2266
	 && (data.rgnData.rdh.iType == RDH_RECTANGLES))  {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2267
	    /* ok, got the region */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2268
	    numRects = data.rgnData.rdh.nCount;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2269
	    pRect = (RECT *)(data.rgnData.Buffer);
6165
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2270
	    DDDDPRINTF(("region numRects=%d\n", numRects));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2271
	} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2272
	    /* a big region ... */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2273
	    GetRgnBox(updRgn, &updRect);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2274
	    numRects = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2275
	    pRect = &updRect;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2276
	    DPRINTF(("very complex region (need:%d have:%d) bounds=%d,%d -> %d,%d\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2277
		     n, sizeof(data),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2278
		     updRect.left, updRect.top,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2279
		     updRect.right, updRect.bottom));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2280
	    if (((updRect.right - updRect.left) <= 0)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2281
	     || ((updRect.bottom - updRect.top) <= 0)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2282
		numRects = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2283
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2284
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2285
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2286
	if (numRects) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2287
	    if (doClear) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2288
		__clearRectangles(hWnd, numRects, pRect);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2289
	    }
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  2290
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  2291
#ifndef PRE_21_NOV
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2292
	for (i=0; i < numRects; i++) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2293
	    ValidateRect( hWnd, &pRect[i] );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2294
	}
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2295
#endif
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  2296
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  2297
#ifdef DEBUG_COLORIZE_WM_PAINT_RECTS1
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2298
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2299
		HDC hDC;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2300
		HBRUSH hBrush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2301
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2302
		hBrush = CreateSolidBrush(BlackPixel);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2303
		hDC = GetWindowDC(hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2304
		SelectClipRgn(hDC, NULL);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2305
		for (i=0; i<numRects; i++) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2306
		    FillRect(hDC, &(pRect[i]), hBrush);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2307
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2308
		_DeleteBrush(hBrush, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2309
		ReleaseDC(hWnd, hDC);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2310
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2311
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2312
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2313
	    if (wantExpose) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2314
		for (i=0; i<numRects; i++) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2315
		    int final = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2316
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2317
		    if ((msgType == __WM_GEXPOSE)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2318
		     && (i == (numRects - 1))) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2319
			final = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2320
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2321
		    enqEvent(ExposureMask, hWnd, msgType, final,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2322
			     (pRect[i].left), (pRect[i].top),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2323
			     (pRect[i].right - pRect[i].left),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2324
			     (pRect[i].bottom - pRect[i].top),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2325
			     EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2326
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2327
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2328
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2329
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2330
	if (updRgn && (updRgn != hRgnInOrNull)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2331
	    _DeleteObject(updRgn, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2332
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2333
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2334
	return numRects;
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2335
}
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2336
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2337
#ifdef THIS_DOES_NOT_AVOID_DOUBLE_REPAINTS
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2338
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2339
BOOL CALLBACK
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2340
recursiveExposeGenerator(HWND hChild, LPARAM param)
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2341
{
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2342
	__generateExposes(hChild, NULL, param, 0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2343
	return TRUE;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2344
}
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2345
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2346
static void
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2347
__generateRecursiveExposes(HWND hWnd, int msgType)
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2348
{
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2349
	EnumChildWindows(hWnd, recursiveExposeGenerator, msgType);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2350
}
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2351
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2352
#endif /* sigh */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2353
2698
3d3fce06ebfa expose Region for scrolls
Claus Gittinger <cg@exept.de>
parents: 2697
diff changeset
  2354
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2355
static int
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  2356
getModifiers(void)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2357
{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2358
    int modifiers = 0;
2404
136a8bb344a8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2389
diff changeset
  2359
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2360
    if (GetKeyState(VK_SHIFT) & 0x8000)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2361
	modifiers |= ShiftMask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2362
    if (GetKeyState(VK_CONTROL) & 0x8000)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2363
	modifiers |= ControlMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2364
#if 0
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2365
    if (GetKeyState(VK_RMENU) & 0x8000)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2366
	modifiers |= RightAltMask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2367
    if (GetKeyState(VK_LMENU) & 0x8000)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2368
	modifiers |= LeftAltMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2369
#else
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2370
    if (GetKeyState(VK_MENU) & 0x8000)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2371
	modifiers |= LeftAltMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2372
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2373
    if (GetKeyState(VK_LBUTTON) & 0x8000)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2374
	modifiers |= Button1Mask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2375
    if (GetKeyState(VK_MBUTTON) & 0x8000)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2376
	modifiers |= Button2Mask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2377
    if (GetKeyState(VK_RBUTTON) & 0x8000)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2378
	modifiers |= Button3Mask;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2379
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  2380
    if ((modifiers & AnyButtonMask) == 0) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2381
	__eatingMouseEvents = 0;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  2382
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2383
    return modifiers;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2384
}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2385
4132
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2386
#ifndef PRE_01_APR_04
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2387
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2388
/* 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
  2389
   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
  2390
*/
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2391
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2392
# define MustHandleButtonEvent()\
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2393
    (((__currentCapture == CAPTURE_NONE)       \
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2394
     && (   (GetKeyState(VK_LBUTTON) & 0x8000) \
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2395
	 || (GetKeyState(VK_MBUTTON) & 0x8000) \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2396
	 || (GetKeyState(VK_RBUTTON) & 0x8000) \
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2397
	)                                      \
4132
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2398
    ) ? 0 : 1)
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2399
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2400
#else
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2401
# define MustHandleButtonEvent()   1
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2402
#endif
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2403
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  2404
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2405
#ifdef HANDLE_VIEWGRAVITY
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2406
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2407
struct gravityCallBackInfo {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2408
    HWND parent;
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2409
    int  currW, currH;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2410
    int  newW, newH;
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
  2411
    int  parentWinX, parentWinY;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2412
};
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2413
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2414
static BOOL CALLBACK
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2415
gravityEnumeratorCallBack(HWND hChild, struct gravityCallBackInfo *iP)
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2416
{
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2417
    localWindowInfo *lI;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2418
    int gravity;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2419
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2420
    if (lI = GETLOCALWINDOWINFOPTR(hChild)) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2421
	if ((gravity = lI->viewGravity) != GRAVITY_NONE) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2422
	    RECT oldChildRct, oldChildWinRct;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2423
	    RECT newChildRct;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2424
	    int deltaW, deltaH;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2425
	    int anyChange = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2426
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2427
	    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2428
	     * get its current bounds ...
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2429
	     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2430
	    GetClientRect(hChild, &oldChildRct);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2431
	    deltaW = iP->newW - iP->currW;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2432
	    deltaH = iP->newH - iP->currH;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2433
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2434
	    GetWindowRect(hChild, &oldChildWinRct);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2435
	    oldChildRct.left = oldChildWinRct.left - iP->parentWinX;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2436
	    oldChildRct.top =  oldChildWinRct.top - iP->parentWinY;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2437
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2438
	    newChildRct = oldChildRct;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2439
	    switch (gravity) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2440
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2441
		case GRAVITY_N:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2442
		    console_fprintf(stderr, "WinWorkstation [info]: Child %x: North gravity\n", hChild);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2443
		    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2444
		     * shift to the bottom, for a constant
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2445
		     * distance from the bottom edge;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2446
		     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2447
		    newChildRct.bottom += deltaH;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2448
		    anyChange = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2449
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2450
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2451
		case GRAVITY_W:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2452
		    console_fprintf(stderr, "WinWorkstation [info]: Child %x: West gravity\n", hChild);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2453
		    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2454
		     * shift to the right, for a constant
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2455
		     * distance from the right edge;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2456
		     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2457
		    newChildRct.right += deltaW;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2458
		    anyChange = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2459
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2460
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2461
		case GRAVITY_S:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2462
		    console_fprintf(stderr, "WinWorkstation [info]: Child %x: South gravity\n", hChild);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2463
		    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2464
		     * shift to the bottom, for a constant
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2465
		     * distance from the bottom edge;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2466
		     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2467
		    newChildRct.top += deltaH;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2468
		    newChildRct.bottom  += deltaH;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2469
		    anyChange = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2470
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2471
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2472
		case GRAVITY_E:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2473
		    console_fprintf(stderr, "WinWorkstation [info]: Child %x: East gravity\n", hChild);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2474
		    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2475
		     * shift to the right, for a constant
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2476
		     * distance from the right edge;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2477
		     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2478
		    newChildRct.right += deltaW;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2479
		    newChildRct.left  += deltaW;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2480
		    anyChange = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2481
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2482
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2483
		case GRAVITY_SE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2484
		    console_fprintf(stderr, "WinWorkstation [info]: Child %x: SouthEast gravity\n", hChild);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2485
		    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2486
		     * shift to the bottom-right, for a constant
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2487
		     * distance from the bottom-right edge;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2488
		     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2489
		    newChildRct.right += deltaW;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2490
		    newChildRct.left  += deltaW;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2491
		    newChildRct.top += deltaH;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2492
		    newChildRct.bottom  += deltaH;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2493
		    anyChange = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2494
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2495
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2496
		default:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2497
		    DPRINTF(("Child %x: other gravity\n", hChild));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2498
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2499
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2500
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2501
	    if (anyChange) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2502
		if ((newChildRct.left < 0)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2503
		 || (newChildRct.top < 0)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2504
		 || (newChildRct.right >= iP->newW)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2505
		 || (newChildRct.bottom >= iP->newH)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2506
		    console_fprintf(stderr, "WinWorkstation [info]: dont move child to: %d/%d -> %d/%d\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2507
				    newChildRct.left, newChildRct.top,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2508
				    newChildRct.right, newChildRct.bottom);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2509
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2510
		    console_fprintf(stderr, "WinWorkstation [info]: move child from %d/%d->%d/%d to: %d/%d->%d/%d\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2511
				    oldChildRct.left, oldChildRct.top,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2512
				    oldChildRct.right, oldChildRct.bottom,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2513
				    newChildRct.left, newChildRct.top,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2514
				    newChildRct.right, newChildRct.bottom);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2515
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2516
		    SetWindowPos(hChild, (HWND)0,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2517
				 newChildRct.left, newChildRct.top,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2518
				 0, 0,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2519
				 /* SWP_NOSENDCHANGING | */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2520
				 SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2521
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2522
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2523
	}
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2524
    }
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2525
    return TRUE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2526
}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2527
#endif /* HANDLE_VIEWGRAVITY */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  2528
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2529
static void
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2530
ch2wch(char *in, wchar_t *out, int nMax)
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2531
{
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2532
    unsigned char *cp = (unsigned char *)in;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2533
    wchar_t *wcp = out;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2534
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2535
    while ((nMax > 1) && cp && *cp) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2536
	*wcp++ = *cp++;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2537
	nMax--;
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2538
    }
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2539
    *wcp = 0;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2540
}
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  2541
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  2542
static int
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2543
winEventProcessing(
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2544
	HWND hWnd,         /* window handle                   */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2545
	UINT message,      /* type of message                 */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2546
	UINT wParam,       /* additional information          */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2547
	INT lParam,        /* additional information          */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2548
	int *pDefault
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  2549
    ) {
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  2550
    int curButton;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2551
    int x, y, w, h;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  2552
    int isNative = 0;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2553
    UINT evTime;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2554
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2555
    /* kludge - info is in msg-struct,
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2556
     * but lost here. (slightly inexact ... but who cares)
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2557
     */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2558
    evTime = lastMSGTime;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2559
    lastMSGTime = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2560
    if (evTime == 0) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2561
	lastMSGTime = GetTickCount();
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2562
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2563
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2564
/*
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  2565
    EVENT_PRINTF(("winEvent hWin=0x%x message=0x%x wP=0x%x lP=0x%x\n",
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2566
			hWnd, message, wParam, lParam));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2567
*/
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2568
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  2569
    if (hWnd) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2570
	if (message != WM_MOUSEMOVE) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2571
	    lastMotionWnd = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2572
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2573
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2574
	isNative = (GetWindow_flag(hWnd) & LI_NATIVEWIN);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2575
	if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2576
	    NDPRINTF(("event %d (0x%x) for nativeWindow\n", message, message));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2577
	}
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  2578
    }
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  2579
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2580
    /*
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2581
     * messages which are enqueued to be handled by the view thread
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2582
     */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  2583
    switch (message) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2584
	case WM_THREAD_CREATEWINDOW:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2585
	    EVENT_PRINTF(("*WM_THREAD_CREATEWINDOW\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2586
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2587
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2588
		createWindowInfo *cwi = (createWindowInfo *)(lParam);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2589
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2590
		if ((cwi->sequenceNr == wParam)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2591
		 && (cwi->sequenceNr != INVALIDATED_CWI)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2592
		    cwi->sequenceNr = INVALIDATED_CWI;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2593
		    cwi->infoWasRead = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2594
		    if (cwi->newWinHandle == NULL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2595
			HANDLE ev;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2596
			HANDLE hwnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2597
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2598
			cwi->newWinHandle = hwnd = CreateWindowExW(
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2599
					    cwi->winStyleBitsEx,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2600
					    cwi->className,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2601
					    cwi->windowName,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2602
					    cwi->winStyleBits,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2603
					    cwi->x, cwi->y,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2604
					    cwi->dx, cwi->dy,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2605
					    cwi->parentHandle,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2606
					    NULL,           /* menu */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2607
					    (HANDLE) __getHInstance(),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2608
					    cwi->localWindowInfo
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2609
					   );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2610
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2611
			if (hwnd == NULL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2612
			    cwi->errCode = GetLastError();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2613
			    console_fprintf(stderr, "WinWorkstation [info]: CreateWindow failed: %d (0x%x) [%d]\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2614
						cwi->errCode, cwi->errCode, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2615
			} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2616
			    SETLOCALWINDOWINFOPTR(hwnd, cwi->localWindowInfo);
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  2617
#ifdef DEBUG /* PARANOIA */
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2618
			    if (GETLOCALWINDOWINFOPTR(hwnd) != cwi->localWindowInfo) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2619
			       console_fprintf(stderr, "lI-Error\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2620
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2621
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2622
			    SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2623
					/* SWP_NOOWNERZORDER |*/
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2624
					SWP_NOSENDCHANGING | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2625
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2626
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2627
			ev = cwi->hCreateEvent;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2628
			if (ev) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2629
			    SetEvent(ev);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2630
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2631
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2632
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2633
		    DPRINTF(("obsolete createWindow message %x ignored\n", cwi->sequenceNr));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2634
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2635
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2636
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2637
	    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2638
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2639
	case WM_THREAD_DESTROYWINDOW:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2640
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2641
		HBRUSH br;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2642
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2643
		br = GetWindow_viewBgBrush(hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2644
		if (br) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2645
		    SetWindow_viewBgBrush(hWnd, 0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2646
		    _DeleteBrushIfNotInCache(br, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2647
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2648
	    }
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2649
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2650
#ifdef CACHE_LAST_DC
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2651
	    if (lastGcData && (lastGcHWIN == hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2652
		_releaseDC(lastGcData);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2653
	    }
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2654
#endif
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  2655
#ifdef CACHE_LAST_WM_PAINT_DC
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2656
	    if (last_wm_paint_dc && (last_wm_paint_win == hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2657
		ReleaseDC(hWnd, last_wm_paint_dc);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2658
		last_wm_paint_win = last_wm_paint_dc = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2659
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2660
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2661
	    if (! DestroyWindow(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2662
		DPRINTF(("DestroyWindow ERROR\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2663
	    } else {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2664
#ifdef COUNT_RESOURCES
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2665
		__cnt_createWindows--;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2666
		RESPRINTF(("DestroyWindow -> %d\n", __cnt_createWindows));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2667
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2668
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2669
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2670
	    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2671
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2672
	case WM_CREATE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2673
	    {
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  2674
#ifdef SETLOCALINFO_IN_CREATE /* no longer */
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2675
		localWindowInfo *lI;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2676
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2677
		CREATESTRUCT *lpcs = (LPCREATESTRUCT) lParam; // structure with creation data
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2678
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2679
		lI = lpcs->lpCreateParams;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2680
		EVENT_PRINTF(("WM_CREATE lI=%x\n", lI));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2681
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2682
		SETLOCALWINDOWINFOPTR(hWnd, lI);
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  2683
# ifdef SUPERDEBUG
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2684
		if (GETLOCALWINDOWINFOPTR(hWnd) != lpcs->lpCreateParams) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2685
		    PRINTF(("SETLOCALWINDOWINFOPTR ERROR\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2686
		}
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  2687
# endif /* SUPERDEBUG */
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  2688
#endif
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  2689
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2690
		*pDefault = 0;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2691
#ifdef COUNT_RESOURCES
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2692
		__cnt_createWindows++;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2693
		RESPRINTF(("CreateWindows %d\n",__cnt_createWindows));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2694
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2695
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2696
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2697
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2698
	case WM_CLOSE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2699
	    EVENT_PRINTF(("WM_CLOSE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2700
	    if (! destroyWin) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2701
		// (flag, hWnd, message, wParam, arg1, arg2, arg3, arg4, evTime)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2702
		enqEvent(0, hWnd, WM_CLOSE, wParam, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2703
	    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2704
		destroyWin = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2705
		{
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2706
		    HBRUSH br;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2707
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2708
		    br = GetWindow_viewBgBrush(hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2709
		    if (br) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2710
			SetWindow_viewBgBrush(hWnd, 0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2711
			_DeleteBrushIfNotInCache(br, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2712
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2713
		}
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2714
#ifdef CACHE_LAST_DC
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2715
		if (lastGcData && (lastGcHWIN == hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2716
		    _releaseDC(lastGcData);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2717
		}
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  2718
#endif
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  2719
#ifdef CACHE_LAST_WM_PAINT_DC
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2720
		if (last_wm_paint_dc && (last_wm_paint_win == hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2721
		    ReleaseDC(hWnd, last_wm_paint_dc);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2722
		    last_wm_paint_win = last_wm_paint_dc = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2723
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2724
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2725
		if (! DestroyWindow(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2726
		    DPRINTF(("DestroyWindow ERROR\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2727
		} else {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  2728
#ifdef COUNT_RESOURCES
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2729
		    __cnt_createWindows--;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2730
		    RESPRINTF(("DestroyWindow -> %d\n", __cnt_createWindows));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2731
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2732
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2733
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2734
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2735
	    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2736
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2737
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2738
	case WM_DESTROY:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2739
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2740
		char *nm = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2741
		localWindowInfo *lI;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2742
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2743
		lI = GETLOCALWINDOWINFOPTR(hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2744
		EVENT_PRINTF(("WM_DESTROY %x li=%x\n", hWnd, lI));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  2745
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  2746
#ifdef TOPWINDOWCLASS
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2747
		if (lI) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2748
		    if (lI->flag & LI_TOPWIN) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2749
			nm = (char*) malloc(300);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2750
			GetClassName(hWnd, nm, 300);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2751
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2752
		    /* freeing now done in other thread */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2753
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2754
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2755
		SETLOCALWINDOWINFOPTR(hWnd, 0);
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2756
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  2757
#ifdef FREE_LI_IN_STX_PROCESS
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2758
		enqEvent(0, hWnd, WM_DESTROY, wParam, (INT)nm, lI, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2759
#else
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2760
		if (lI) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2761
		    free(lI);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2762
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2763
		enqEvent(0, hWnd, WM_DESTROY, wParam, (INT)nm, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2764
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2765
		*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2766
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2767
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2768
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2769
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2770
	case WM_GETMINMAXINFO:
4155
b557b9991c9c inform STX about WINDOWPOSCHANGED in EXITSIZEMOVE (not during moving)
ca
parents: 4154
diff changeset
  2771
b557b9991c9c inform STX about WINDOWPOSCHANGED in EXITSIZEMOVE (not during moving)
ca
parents: 4154
diff changeset
  2772
#ifndef PRE_13_APR_04_POSCHANGED_IN_EXITSIZEMOVE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2773
	    if (inMove) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2774
		*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2775
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2776
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2777
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2778
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2779
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2780
		int minW, maxW;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2781
		localWindowInfo *lI;
6494
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2782
		LPMINMAXINFO lpmmi = (LPMINMAXINFO) lParam;
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2783
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2784
		EVENT_PRINTF2(("WM_GETMINMAXINFO handle=%x got min: %d/%d\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2785
			    hWnd,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2786
			    lpmmi->ptMinTrackSize.x,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2787
			    lpmmi->ptMinTrackSize.y));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2788
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2789
		lI = GETLOCALWINDOWINFOPTR(hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2790
		if (lI && (lI->minWidth) && (lI->maxWidth)) {
6494
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2791
		  lpmmi->ptMaxPosition.x = 0;
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2792
		  lpmmi->ptMaxPosition.y = 0;
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2793
		  lpmmi->ptMaxSize.x = lI->currentMonitorWidth;
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2794
		  lpmmi->ptMaxSize.y = lI->currentMonitorHeight;
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2795
#define MIN(a, b) (a < b ? a : b)
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2796
		  lpmmi->ptMaxSize.x = MIN(GetSystemMetrics(SM_CXMAXIMIZED), lI->maxWidth);
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2797
		  lpmmi->ptMaxSize.y = MIN(GetSystemMetrics(SM_CYMAXIMIZED), lI->maxHeight);
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2798
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2799
		  lpmmi->ptMaxTrackSize.x = lI->maxWidth == 0 ? GetSystemMetrics(SM_CXMAXTRACK) : lI->maxWidth;
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2800
		  lpmmi->ptMaxTrackSize.y = lI->maxHeight == 0 ? GetSystemMetrics(SM_CYMAXTRACK) : lI->maxHeight;
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2801
		  lpmmi->ptMinTrackSize.x = lI->minWidth;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2802
		  lpmmi->ptMinTrackSize.y = lI->minHeight;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2803
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2804
		  EVENT_PRINTF3(("WM_GETMINMAXINFO handle=%x return min: %d/%d max: %d/%d\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2805
				  hWnd,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2806
				  lI->minWidth, lI->minHeight,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2807
				  lI->maxWidth, lI->maxHeight));
6494
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2808
		  *pDefault = 0;
e0f0e0570c4a class: WinWorkstation
Stefan Vogel <sv@exept.de>
parents: 6486
diff changeset
  2809
		}
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2810
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2811
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2812
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2813
	case WM_SETCURSOR:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2814
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2815
		HCURSOR curs;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2816
		int hitCode;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2817
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2818
		hitCode = LOWORD(lParam);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2819
		if (hitCode != HTCLIENT) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2820
		    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2821
		     * not in client area ...
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2822
		     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2823
		    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2824
		}
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  2825
		DPRINTFIF(__debug_WM_SETCURSOR__ , ("WM_SETCURSOR\n"));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2826
		curs = GetWindow_Cursor(hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2827
		if (curs) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2828
		    SetCursor(curs);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2829
		    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2830
		    return 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2831
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2832
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2833
	    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2834
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2835
	case WM_WINDOWPOSCHANGED:
4155
b557b9991c9c inform STX about WINDOWPOSCHANGED in EXITSIZEMOVE (not during moving)
ca
parents: 4154
diff changeset
  2836
b557b9991c9c inform STX about WINDOWPOSCHANGED in EXITSIZEMOVE (not during moving)
ca
parents: 4154
diff changeset
  2837
#ifndef PRE_13_APR_04_POSCHANGED_IN_EXITSIZEMOVE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2838
	    if (inMove) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2839
		*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2840
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2841
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2842
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2843
	    if (hWnd == __rootWinSpezial) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2844
		/* can this happen ? */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2845
		*pDefault = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2846
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2847
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2848
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2849
	    if (! inMove && (__currentCapture == CAPTURE_NONE)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2850
		POINT p;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2851
		HWND hWndChild,hWndTemp;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2852
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2853
		p.x = evRootX;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2854
		p.y = evRootY;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2855
		ScreenToClient(hWnd, &p);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2856
		hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2857
		do {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2858
		    hWndTemp = hWndChild;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2859
		    hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2860
		} while ((hWndChild) && (hWndChild != hWndTemp));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2861
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2862
		if (hWndChild /*&& (hWndChild != hWnd)*/) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2863
		    if (hWndChild != __currentPointerView) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2864
			int modifiers = getModifiers();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2865
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2866
			if (__currentPointerView) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2867
			    if (inSizeMove) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2868
				if (needDelayedMouseLeaveWindow == NULL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2869
				    needDelayedMouseLeaveWindow = __currentPointerView;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2870
				}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2871
			    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2872
				if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2873
				    enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2874
				    SetWindow_mouseXY(__currentPointerView, -9999, -9999);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2875
				}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2876
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2877
			    __currentPointerView = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2878
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2879
			if (inSizeMove) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2880
			    needDelayedMouseEnterWindow = hWndChild;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2881
			    delayedMouseEnterX = evRootX;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2882
			    delayedMouseEnterY = evRootY;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2883
			} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2884
			    if (GetWindow_eventMask(hWndChild) & EnterWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2885
				enqEvent(EnterWindowMask, hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2886
				SetWindow_mouseXY(hWndChild, evRootX, evRootY);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2887
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2888
			    // SetFocus(hWndChild);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2889
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2890
			__currentPointerView = hWndChild;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2891
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2892
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2893
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2894
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2895
	    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2896
	     * ignore child window messages ...
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2897
	     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2898
	    if (GetParent(hWnd) != NULL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2899
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2900
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2901
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2902
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2903
		WINDOWPOS *wp = (WINDOWPOS *)lParam;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2904
		RECT rct, dRect;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2905
		int x, y, w, h;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2906
		int dW, dH;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2907
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2908
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2909
		dRect.left = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2910
		dRect.top = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2911
		dRect.right = 100;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2912
		dRect.bottom = 100;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2913
		winStyleBits = GetWindowLong(hWnd, GWL_STYLE);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2914
		winExStyleBits = GetWindowLong(hWnd, GWL_EXSTYLE);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2915
		AdjustWindowRectEx(&dRect, winStyleBits, 0, winExStyleBits);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2916
		dW = dRect.right - dRect.left;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2917
		dH = dRect.bottom - dRect.top;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2918
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2919
		GetClientRect(hWnd, &rct);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2920
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2921
		x = rct.left;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2922
		y = rct.top;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2923
		w = rct.right - rct.left;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2924
		h = rct.bottom - rct.top;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2925
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2926
		if (__debug__) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2927
		    EVENT_PRINTF(("WM_WINDOWPOSCHANGED ["));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2928
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2929
		    if (wp->flags & SWP_NOSIZE) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2930
			EVENT_PRINTF(("NOSIZE "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2931
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2932
		    if (wp->flags & SWP_NOMOVE) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2933
			EVENT_PRINTF(("NOMOVE "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2934
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2935
		    if (wp->flags & SWP_NOZORDER) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2936
			EVENT_PRINTF(("NOZORDER "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2937
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2938
		    if (wp->flags & SWP_NOREDRAW) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2939
			EVENT_PRINTF(("NOREDRAW "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2940
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2941
		    if (wp->flags & SWP_NOACTIVATE) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2942
			EVENT_PRINTF(("NOACTIVATE "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2943
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2944
		    if (wp->flags & SWP_FRAMECHANGED) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2945
			EVENT_PRINTF(("FRAMECHANGED "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2946
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2947
		    if (wp->flags & SWP_NOCOPYBITS) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2948
			EVENT_PRINTF(("NOCOPYBITS "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2949
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2950
		    if (wp->flags & SWP_NOOWNERZORDER) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2951
			EVENT_PRINTF(("NOOWNERZORDER "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2952
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2953
		    if (wp->flags & SWP_NOSENDCHANGING) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2954
			EVENT_PRINTF(("NOSENDCHANGING "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2955
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2956
		    if (wp->flags & SWP_DEFERERASE) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2957
			EVENT_PRINTF(("DEFERERASE "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2958
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2959
		    if (wp->flags & SWP_ASYNCWINDOWPOS) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2960
			EVENT_PRINTF(("ASYNCWINDOWPOS "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2961
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2962
		    if (wp->flags & SWP_HIDEWINDOW) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2963
			EVENT_PRINTF(("HIDEWINDOW "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2964
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2965
		    if (wp->flags & SWP_SHOWWINDOW) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2966
			EVENT_PRINTF(("SHOWWINDOW "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2967
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2968
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2969
		    EVENT_PRINTF(("] %d/%d %d/%d flags:%d (0x%x) ->",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2970
				wp->x, wp->y, wp->cx, wp->cy, wp->flags, wp->flags));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2971
		    EVENT_PRINTF(("  client rect now: %d/%d %d/%d\n",x, y, w, h));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2972
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2973
		} /* __debug__ */
6165
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2974
#ifdef THIS_IS_WRONG
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2975
		if (!(wp->flags & SWP_NOSIZE)) {
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2976
		    EVENT_PRINTF(("w,h: %d/%d vs. %d/%d\n", wp->cx, wp->cy, w, h));
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2977
		    w = wp->cx;
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2978
		    h = wp->cy;
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2979
		}
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2980
		if (!(wp->flags & SWP_NOMOVE)) {
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2981
		    EVENT_PRINTF(("x,y: %d/%d vs. %d/%d\n", wp->x, wp->y, x, y));
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2982
		    x = wp->x;
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2983
		    y = wp->y;
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2984
		}
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2985
#endif
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  2986
		lastPos_win = 0;
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2987
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2988
		if ((w == 0) && (h == 0)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2989
		    EVENT_PRINTF(("w,h = 0.\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2990
		    if (! GetWindow_iconified(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2991
			EVENT_PRINTF(("iconified.\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2992
			SetWindow_iconified(hWnd, 1);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2993
			DPRINTF(("WM_WINDOWPOSCHANGED to iconified (flags:0x%x)\n", wp->flags));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2994
			enqEvent(0, hWnd, __WM_ICONIFIED, 1, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2995
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2996
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2997
		    if (GetWindow_iconified(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2998
			EVENT_PRINTF(("deiconified.\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  2999
			SetWindow_iconified(hWnd, 0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3000
			DPRINTF(("WM_WINDOWPOSCHANGED to deiconified (flags:0x%x)\n", wp->flags));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3001
			enqEvent(0, hWnd, __WM_ICONIFIED, 0, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3002
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3003
		    if (!(wp->flags & SWP_NOSIZE)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3004
		     || !(wp->flags & SWP_NOMOVE)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3005
			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
  3006
#ifdef COMPRESS_WINDOWPOSCHANGED
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3007
			/*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3008
			 * remember the current
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3009
			 * window and size;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3010
			 * This allows the backend to ignore
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3011
			 * intermediate events.
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3012
			 */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3013
			lastPos_w = w;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3014
			lastPos_h = h;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3015
			lastPos_x = x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3016
			lastPos_y = y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3017
			lastPos_win = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3018
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3019
			enqEvent(0, hWnd, WM_WINDOWPOSCHANGED, 0, x, y, w, h, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3020
		    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3021
			EVENT_PRINTF(("no event due to SWP_NOSIZE/SWP_NOMOVE.\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3022
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3023
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3024
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3025
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3026
	    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3027
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3028
	case WM_ERASEBKGND:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3029
	    DPRINTFIF(__debug_WM_ERASEBKGND__ , ("WM_ERASEBKGND\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3030
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3031
		NDPRINTF(("WM_ERASEBKGND for native - default handling\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3032
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3033
	    }
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  3034
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  3035
#ifndef PRE_21_NOV
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3036
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3037
	    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3038
#else
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3039
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3040
	    if (GetWindow_flag(hWnd) & LI_INPUTWIN) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3041
		*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3042
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3043
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3044
	    if (hWnd == __rootWinSpezial) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3045
		*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3046
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3047
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3048
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3049
	    /* THIS_WORKS */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3050
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3051
	    return 0;
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  3052
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  3053
#endif  /* ! PRE_21_NOV */
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  3054
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3055
	case WM_PAINT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3056
	    DPRINTFIF(__debug_WM_PAINT__ , ("WM_PAINT ********************* "));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3057
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3058
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3059
		NDPRINTF(("WM_PAINT for native - default handling\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3060
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3061
	    }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  3062
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  3063
#ifndef PRE_21_NOV
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3064
	    {   int n;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3065
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3066
		n = __generateExposes( hWnd, NULL, WM_PAINT, 0 );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3067
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3068
		if( n <= 0 ) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3069
		    * pDefault = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3070
		    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3071
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3072
		* pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3073
		return n;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3074
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3075
#else
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3076
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3077
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3078
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3079
	    if (GetWindow_flag(hWnd) & LI_INPUTWIN) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3080
		*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3081
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3082
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3083
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3084
	    if (hWnd == __rootWinSpezial) {
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  3085
# ifdef THIS_MAKES_GUI_PAINTER_START_SLOW
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3086
		*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3087
# endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3088
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3089
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3090
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3091
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3092
		int retVal;
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3093
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  3094
# ifdef LATE_GENERATE_EXPOSE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3095
		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
  3096
# else
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3097
		AQUIRE_DRAW_MUTEX
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3098
		retVal = __generateExposes(hWnd, NULL, WM_PAINT, WM_PAINT_CLEAR_EARLY);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3099
		RELEASE_DRAW_MUTEX
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3100
# endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3101
		switch (retVal) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3102
		    case -1:  /* error */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3103
			*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3104
			break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3105
		    case 0:   /* nothing generated */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3106
		    default:  /* generated events */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3107
			break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3108
		}
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3109
# ifdef THIS_IS_BAD
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3110
		*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3111
		return 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3112
# endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3113
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3114
	    return 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3115
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  3116
#endif  /* ! PRE_21_NOV */
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
  3117
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3118
	case WM_SIZE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3119
	    DPRINTFIF(__debug_WM_SIZE__ , ("WM_SIZE\n"));
6165
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  3120
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  3121
	    lastPos_win = 0;
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3122
	    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3123
	     * ignore child window messages ...
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3124
	     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3125
	    if (GetParent(hWnd) != NULL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3126
		*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3127
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3128
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3129
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3130
	    switch (wParam) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3131
		case SIZE_MAXIMIZED:     /* default handling */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3132
		case SIZE_MINIMIZED:     /* default handling */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3133
		case SIZE_RESTORED:      /* default handling */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3134
		    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3135
			RECT rct;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3136
			int x, y, w, h;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3137
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3138
			GetClientRect(hWnd, &rct);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3139
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3140
			x = rct.left;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3141
			y = rct.top;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3142
			w = rct.right - rct.left;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3143
			h = rct.bottom - rct.top;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3144
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3145
			EVENT_PRINTF(("WM_MIN/MAX/RESTORED\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3146
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3147
			if ((w == 0) && (h == 0)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3148
			    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3149
			     * iconified ...
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3150
			     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3151
			    if (! GetWindow_iconified(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3152
				SetWindow_iconified(hWnd, 1);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3153
				enqEvent(0, hWnd, __WM_ICONIFIED, 1, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3154
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3155
			} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3156
			    if (GetWindow_iconified(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3157
				SetWindow_iconified(hWnd, 0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3158
				enqEvent(0, hWnd, __WM_ICONIFIED, 0, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3159
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3160
			    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
  3161
#ifdef COMPRESS_WINDOWPOSCHANGED
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3162
			    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3163
			     * remember the current
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3164
			     * window and size;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3165
			     * This allows the backend to ignore
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3166
			     * intermediate events.
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3167
			     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3168
			    lastPos_w = w;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3169
			    lastPos_h = h;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3170
			    lastPos_x = x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3171
			    lastPos_y = y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3172
			    lastPos_win = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3173
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3174
			    enqEvent(0, hWnd, WM_WINDOWPOSCHANGED, 0, x, y, w, h, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3175
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3176
		   }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3177
		   break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3178
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3179
		default:                 /* ignore */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3180
		    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3181
		    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3182
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3183
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3184
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3185
	case WM_DROPFILES:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3186
	    DPRINTFIF(__debug_WM_DROPFILES__ , ("WM_DROPFILES\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3187
	    enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3188
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3189
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3190
	case WM_SHOWWINDOW:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3191
	    DPRINTFIF(__debug_WM_SHOWWINDOW__ , ("WM_SHOWWINDOW h=%x\n", hWnd));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3192
	    enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3193
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3194
		NDPRINTF(("WM_SHOWWINDOW for native - default handling\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3195
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3196
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3197
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3198
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3199
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3200
	case WM_MOUSEACTIVATE :
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3201
	    DPRINTFIF(__debug_WM_MOUSEACTIVATE__ , ("WM_MOUSEACTIVATE h=%x parent=%x\n", hWnd, GetParent(hWnd)));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3202
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3203
	    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3204
	     * ignore child window messages ...
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3205
	     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3206
	    if (GetParent(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3207
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3208
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3209
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3210
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3211
	    if ((hWnd == __rootWinSpezial) || (hWnd == GetActiveWindow())) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3212
		DDPRINTF(("NOACTIVATE (root or already)\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3213
		return MA_NOACTIVATE;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3214
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3215
	    if (LOWORD(lParam) != HTCLIENT) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3216
		DDPRINTF(("ACTIVATE (not client)\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3217
		return MA_ACTIVATE;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3218
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3219
	    if (__activateOnClick) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3220
		if (__ignoreButtonPressOnActivate) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3221
		    DDPRINTF(("ACTIVATE_EAT\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3222
		    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3223
		     * windows is sooo stupid:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3224
		     * it will send me a MOTION soon after, with the
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3225
		     * to the click location, with the buttonState down.
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3226
		     * The app will interpret that as a pressed motion and
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3227
		     * do a selection (if in a textview).
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3228
		     * To prevent this, we set a flag here, that the following
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3229
		     * motion is to be suppressed.
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3230
		     * Until the mouse is released.
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3231
		     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3232
		    __eatingMouseEvents = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3233
		    return MA_ACTIVATEANDEAT;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3234
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3235
		DDPRINTF(("ACTIVATE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3236
		return MA_ACTIVATE;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3237
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3238
	    DDPRINTF(("NO_ACTIVATE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3239
	    return MA_NOACTIVATE;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3240
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3241
	case WM_NCHITTEST:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3242
	    EVENT_PRINTF2(("WM_NCHITTEST\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3243
	    if (hWnd == __rootWinSpezial) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3244
		*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3245
		return HTCLIENT;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3246
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3247
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3248
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3249
	case WM_NCACTIVATE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3250
	    EVENT_PRINTF(("WM_NCACTIVATE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3251
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3252
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3253
	case WM_ACTIVATE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3254
	    CPRINTF(("WM_ACTIVATE %s h=%x\n", LOWORD(wParam) ? "active" : "inactive", hWnd));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3255
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3256
	    switch (LOWORD(wParam)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3257
		case WA_INACTIVE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3258
		    EVENT_PRINTF2(("WM_ACTIVATE inactive h=%x\n", hWnd));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3259
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3260
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3261
		case WA_ACTIVE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3262
		    EVENT_PRINTF2(("WM_ACTIVATE active h=%x\n", hWnd));
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3263
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3264
#ifdef THIS_DOES_NOT_AVOID_DOUBLE_REPAINTS
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3265
		    __generateRecursiveExposes(hWnd, WM_PAINT);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  3266
#endif /* sigh */
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3267
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3268
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3269
		case WA_CLICKACTIVE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3270
		    EVENT_PRINTF2(("++ WM_ACTIVATE clkactive h=%x\n", hWnd));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3271
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3272
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3273
		default:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3274
		    EVENT_PRINTF2(("WM_ACTIVATE ? h=%x\n", hWnd));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3275
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3276
	    }
3962
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3277
425f5e384a15 enable cash PEN and BRUSH
ca
parents: 3961
diff changeset
  3278
#ifndef PRE_25_NOV_03
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3279
	    if (__currentCapture == CAPTURE_NONE) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3280
		HWND  newHWnd = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3281
		POINT newPoint;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3282
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3283
		if (LOWORD(wParam) != WA_INACTIVE) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3284
		    if (MustHandleButtonEvent()) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3285
			newPoint.x = evRootX;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3286
			newPoint.y = evRootY;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3287
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3288
			newHWnd = WindowFromPoint (newPoint);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3289
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3290
			if (newHWnd) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3291
			    if ( (newHWnd == hWnd) || IsChild(hWnd, newHWnd) ) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3292
				ScreenToClient (newHWnd, & newPoint);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3293
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3294
				if ((newPoint.x < 0) || (newPoint.y < 0)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3295
				    newHWnd = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3296
				}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3297
			    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3298
				newHWnd = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3299
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3300
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3301
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3302
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3303
		CPRINTF(( "Old Handle: %x New Handle: %x  x:%d y:%d\n", __currentPointerView, newHWnd, newPoint.x, newPoint.y));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3304
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3305
		if (newHWnd != __currentPointerView) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3306
		    int modifiers = getModifiers();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3307
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3308
		    if (__currentPointerView) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3309
			if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3310
			    enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3311
			    SetWindow_mouseXY(__currentPointerView, -9999, -9999);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3312
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3313
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3314
		    __currentPointerView = newHWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3315
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3316
		    if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3317
			enqEvent(EnterWindowMask, __currentPointerView, __WM_MOUSEENTER, 0, newPoint.x, newPoint.y, 0, modifiers, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3318
			SetWindow_mouseXY(__currentPointerView, newPoint.x, newPoint.y);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3319
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3320
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3321
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3322
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3323
	    enqEvent(0, hWnd, WM_ACTIVATE, wParam, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3324
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3325
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3326
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3327
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3328
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3329
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3330
	case WM_HOTKEY:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3331
	    // console_fprintf(stderr, "winEventProcessing [info]: receive hotkey %x\n",wParam);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3332
	    DPRINTFIF(__debug_WM_KEYUP__ , ("WM_HOTKEY %x\n", wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3333
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3334
		enqEvent(0, hWnd, WM_HOTKEY, wParam, lParam, 0, 0, 0, evTime);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3335
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3336
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3337
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3338
	case WM_SYSCHAR:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3339
	    EVENT_PRINTF2(("WM_SYSCHAR h=%x %x\n", hWnd, wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3340
	    goto commonChar;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3341
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  3342
#ifdef WM_UNICHAR
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3343
	/* does not work, anyway */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3344
	case WM_UNICHAR:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3345
	    DPRINTFIF(__debug_WM_CHAR__ , ("WM_UNICHAR h=%x %x\n", hWnd, wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3346
	    if (wParam == UNICODE_NOCHAR) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3347
		/* this is a query from windows to see if I am able to receive unicode... */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3348
		*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3349
		return 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3350
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3351
	    goto commonChar;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3352
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3353
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3354
	case WM_CHAR:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3355
	    DPRINTFIF(__debug_WM_CHAR__ , ("WM_CHAR h=%x %x\n", hWnd, wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3356
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3357
	    EVENT_PRINTF2(("WM_CHAR h=%x %x\n", hWnd, wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3358
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3359
	commonChar:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3360
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3361
		NDPRINTF(("WM_CHAR for native - default handling\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3362
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3363
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3364
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3365
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3366
		HWND destWindow;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3367
		int evMask;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3368
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3369
		if (__focusFollowsMouse) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3370
		    destWindow = __currentPointerView;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3371
		    if (destWindow == 0) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3372
			destWindow = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3373
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3374
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3375
		    destWindow = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3376
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3377
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3378
		evMask = GetWindow_eventMask(destWindow);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3379
		if (evMask & (KeyPressMask | KeyReleaseMask)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3380
		    POINT p;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3381
		    int modifiers = getModifiers();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3382
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3383
		    p.x = evRootX;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3384
		    p.y = evRootY;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3385
		    ScreenToClient(destWindow, &p);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3386
		    x = p.x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3387
		    y = p.y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3388
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3389
		    DPRINTFIF(__debug_WM_CHAR__ , ("key:%x modifiers: %x\n", wParam, modifiers));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3390
		    if (evMask & KeyPressMask)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3391
			enqEvent(KeyPressMask, destWindow, WM_KEYDOWN, wParam, x, y, lParam, (modifiers | TRANSLATED_KEY), evTime);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3392
		    if (evMask & KeyReleaseMask)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3393
			enqEvent(KeyReleaseMask, destWindow, WM_KEYUP, wParam, x, y, lParam, (modifiers | TRANSLATED_KEY), evTime);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3394
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3395
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3396
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3397
	    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3398
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3399
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3400
	case WM_KEYUP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3401
	    DPRINTFIF(__debug_WM_KEYUP__ , ("WM_KEYUP h=%x %x\n", hWnd, wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3402
	    goto commonKeyUp;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3403
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3404
	case WM_SYSKEYUP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3405
	    DPRINTFIF(__debug_WM_KEYUP__ , ("WM_SYSKEYUP %x\n, wParam"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3406
	commonKeyUp:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3407
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3408
		NDPRINTF(("WM_KEYUP/WM_SYSKEYUP for native - default handling\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3409
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3410
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3411
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3412
		HWND destWindow;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3413
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3414
		if (__focusFollowsMouse) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3415
		    destWindow = __currentPointerView;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3416
		    if (destWindow == 0) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3417
			destWindow = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3418
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3419
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3420
		    destWindow = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3421
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3422
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3423
		if (GetWindow_eventMask(destWindow) & KeyReleaseMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3424
		    POINT p;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3425
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3426
		    p.x = evRootX;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3427
		    p.y = evRootY;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3428
		    ScreenToClient(destWindow, &p);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3429
		    x = p.x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3430
		    y = p.y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3431
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3432
		    enqEvent(KeyReleaseMask, destWindow, message, wParam, x, y, lParam, getModifiers(), evTime);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3433
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3434
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3435
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3436
	    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3437
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3438
	case WM_SYSKEYDOWN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3439
	    DPRINTFIF(__debug_WM_KEYDOWN__ , ("WM_SYSKEYDOWN %x\n, wParam"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3440
	    goto commonKey;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3441
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3442
	case WM_KEYDOWN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3443
	    DPRINTFIF(__debug_WM_KEYDOWN__ , ("WM_KEYDOWN h=%x %x\n", hWnd, wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3444
	commonKey:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3445
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3446
		NDPRINTF(("WM_KEYDOWN/WM_SYSKEYDOWN for native - default handling\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3447
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3448
	    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  3449
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3450
#ifdef EXIT_WITH_3_CTRL_Cs
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3451
	    if ((msg.wParam == 'c')
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3452
	     && (GetKeyState(VK_CONTROL) & 0x8000)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3453
		/* CTRL-C */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3454
		if (ctrl_c_count++ > 3)  /* for debugging */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3455
		    exit(1);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3456
	    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3457
		if (msg.wParam != VK_CONTROL)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3458
		    ctrl_c_count = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3459
	    }
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
  3460
#endif
3564
48b86448bddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3562
diff changeset
  3461
#ifdef RELEASE_CAPTURE_WITH_3_ESCAPEs
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3462
	    if (msg.wParam == VK_ESCAPE)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3463
		/* ESCAPE */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3464
		if (escape_count++ > 3) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3465
		    __currentCapture = CAPTURE_NONE;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3466
		    ReleaseCapture();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3467
		    CPRINTF(("ReleaseCapture <ESC>\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3468
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3469
	    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3470
		escape_count = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3471
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3472
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3473
	    /* FALL INTO */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3474
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3475
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3476
		HWND destWindow;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3477
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3478
		if (__focusFollowsMouse) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3479
		    destWindow = __currentPointerView;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3480
		    if (destWindow == 0) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3481
			destWindow = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3482
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3483
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3484
		    destWindow = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3485
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3486
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3487
		if (GetWindow_eventMask(destWindow) & KeyPressMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3488
		    POINT p;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3489
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3490
		    p.x = evRootX;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3491
		    p.y = evRootY;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3492
		    ScreenToClient(destWindow, &p);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3493
		    x = p.x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3494
		    y = p.y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3495
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3496
		    enqEvent(KeyPressMask, destWindow, message, wParam, x, y, lParam, getModifiers(), evTime);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3497
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3498
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3499
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3500
	    return 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3501
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  3502
#ifdef WM_MOUSEWHEEL
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3503
	case WM_MOUSEWHEEL:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3504
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3505
		HWND destWindow;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3506
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3507
		if (__focusFollowsMouse) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3508
		    destWindow = __currentPointerView;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3509
		    if (destWindow == 0) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3510
			destWindow = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3511
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3512
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3513
		    destWindow = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3514
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3515
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3516
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3517
		EVENT_PRINTF(("WM_MOUSEWHEEL h=%x wP=%x lP=%x\n", hWnd, wParam, lParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3518
		if (GetWindow_eventMask(destWindow) & KeyPressMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3519
		    POINT p;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3520
		    int delta;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3521
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3522
		    p.x = evRootX;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3523
		    p.y = evRootY;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3524
		    ScreenToClient(destWindow, &p);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3525
		    x = p.x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3526
		    y = p.y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3527
		    delta = evTime - lastMouseWheelTime;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3528
		    if (evTime < lastMouseWheelTime) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3529
			delta = (0xFFFFFFFF - lastMouseWheelTime) + evTime;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3530
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3531
		    enqEvent(0, destWindow, message, wParam, x, y, lParam, getModifiers(), delta);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3532
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3533
		lastMouseWheelTime = evTime;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3534
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3535
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3536
	    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3537
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3538
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3539
	case WM_MOUSEMOVE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3540
	    DPRINTFIF(__debug_WM_MOUSEMOVE__ , ("WM_MOUSEMOVE h=%x\n", hWnd));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3541
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3542
		NDPRINTF(("WM_MOUSEMOVE for native - default handling\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3543
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3544
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3545
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3546
	    if (hWnd != __currentPointerView) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3547
		if (! MustHandleButtonEvent()) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3548
		    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3549
		    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3550
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3551
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3552
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3553
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3554
		short x, y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3555
		int modifiers = getModifiers();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3556
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3557
		x = (int)(short)LOWORD(lParam);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3558
		y = (int)(short)HIWORD(lParam);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3559
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3560
		if (__currentCapture == CAPTURE_NONE) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3561
		    if (hWnd != __currentPointerView) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3562
			HWND prevPointerView;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3563
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3564
			prevPointerView = __currentPointerView;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3565
			if (prevPointerView) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3566
			    if (inSizeMove) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3567
				if (needDelayedMouseLeaveWindow == NULL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3568
				    needDelayedMouseLeaveWindow = __currentPointerView;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3569
				}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3570
			    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3571
				if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3572
				    enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, evTime);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3573
				    SetWindow_mouseXY(__currentPointerView, -9999, -9999);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3574
				}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3575
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3576
			    __currentPointerView = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3577
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3578
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3579
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3580
			if (__activateOnClick) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3581
			    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3582
			     * only send mouseEnter if the window belongs to the current
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3583
			     * active window
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3584
			     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3585
			    if (GetTopParent(prevPointerView) == GetTopParent(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3586
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3587
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3588
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3589
			if (inSizeMove) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3590
			    needDelayedMouseEnterWindow = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3591
			    delayedMouseEnterX = x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3592
			    delayedMouseEnterY = y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3593
			} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3594
			    if (GetWindow_eventMask(hWnd) & EnterWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3595
				enqEvent(EnterWindowMask, hWnd, __WM_MOUSEENTER, 0, x, y, 0, modifiers, evTime);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3596
				SetWindow_mouseXY(hWnd, x, y);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3597
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3598
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3599
			__currentPointerView = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3600
		    }
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3601
		    DPRINTFIF(__debug_WM_MOUSEMOVE__ , ("MouseMove %x\n", __currentPointerView));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3602
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3603
		    CPRINTF(("MouseMove Capture %x\n", __currentPointerView));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3604
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3605
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3606
		if ((GetWindow_eventMask(__currentPointerView) & PointerMotionMask)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3607
		 || (modifiers & AnyButtonMask)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3608
		    if (! __eatingMouseEvents) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3609
			if ((x == lastMotionX)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3610
			 && (y == lastMotionY)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3611
			 && (__currentPointerView == lastMotionWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3612
			    /* ignore */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3613
			} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3614
			    lastMotionX = x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3615
			    lastMotionY = y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3616
			    lastMotionWnd = __currentPointerView;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3617
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3618
			    if ((GetWindow_mouseX(__currentPointerView) == x)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3619
			     && (GetWindow_mouseY(__currentPointerView) == y)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3620
			    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3621
				enqEvent(PointerMotionMask, __currentPointerView, WM_MOUSEMOVE, wParam, x, y, 0, modifiers, evTime);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3622
				SetWindow_mouseXY(__currentPointerView, x, y);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3623
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3624
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3625
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3626
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3627
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3628
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3629
	    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3630
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3631
	case WM_LBUTTONUP:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3632
	    DPRINTFIF(__debug_WM_BUTTONUP__ , ("WM_LBUTTONUP h=%x\n", hWnd));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3633
	    curButton = Button1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3634
	    goto commonButtonUp;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3635
	case WM_MBUTTONUP:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3636
	    DPRINTFIF(__debug_WM_BUTTONUP__ , ("WM_MBUTTONUP h=%x\n", hWnd));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3637
	    curButton = Button2;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3638
	    goto commonButtonUp;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3639
	case WM_RBUTTONUP:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3640
	    DPRINTFIF(__debug_WM_BUTTONUP__ , ("WM_RBUTTONUP h=%x\n", hWnd));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3641
	    curButton = Button3;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  3642
commonButtonUp:
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3643
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3644
		NDPRINTF(("WM_*BUTTONUP for native - default handling\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3645
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3646
	    }
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  3647
4132
be6232941cde discard button events if button was pressed in another view
ca
parents: 4113
diff changeset
  3648
#ifndef PRE_01_APR_04
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3649
	    if ((__currentPointerView != hWnd) && (__currentPointerView == (HANDLE)0)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3650
		__currentPointerView = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3651
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3652
		if (GetWindow_eventMask(hWnd) & EnterWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3653
		    POINT p;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3654
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3655
		    p.x = evRootX;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3656
		    p.y = evRootY;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3657
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3658
		    ScreenToClient (hWnd, & p);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3659
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3660
		    if ((p.x >= 0) && (p.y >= 0)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3661
			enqEvent(EnterWindowMask, hWnd, __WM_MOUSEENTER, 0, p.x, p.y, 0, getModifiers(), EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3662
			SetWindow_mouseXY(hWnd, p.x, p.y);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3663
		    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3664
			__currentPointerView = (HANDLE) 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3665
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3666
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3667
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3668
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3669
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3670
	    if (__currentCapture == curButton /* CAPTURE_IMPLICIT*/) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3671
		__currentCapture = CAPTURE_NONE;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3672
		ReleaseCapture();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3673
		CPRINTF(("ReleaseCapture <BUTTONUP>\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3674
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3675
	    EVENT_PRINTF3(("WM_BUTTONUP h=%x pos=%d/%d\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3676
			   hWnd, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam)));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3677
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3678
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3679
	    if (GetWindow_eventMask(hWnd) & ButtonReleaseMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3680
		if (__eatingMouseEvents) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3681
		    __eatingMouseEvents = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3682
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3683
		    enqEvent(ButtonReleaseMask, hWnd,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3684
			     message, wParam, (UINT)(short)LOWORD(lParam), (INT)(short)HIWORD(lParam),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3685
			     wParam, getModifiers(), evTime);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3686
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3687
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3688
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3689
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3690
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3691
	case WM_LBUTTONDBLCLK:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3692
	    DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_LBUTTONDBLCLK h=%x\n", hWnd));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3693
	    curButton = Button1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3694
	    goto commonButtonDown;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3695
	case WM_MBUTTONDBLCLK:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3696
	    DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_MBUTTONDBLCLK h=%x\n", hWnd));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3697
	    curButton = Button2;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3698
	    goto commonButtonDown;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3699
	case WM_RBUTTONDBLCLK:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3700
	    DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_RBUTTONDBLCLK h=%x\n", hWnd));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3701
	    curButton = Button3;
5600
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
  3702
#ifdef PRE_25_AUG_2010
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3703
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3704
		 NDPRINTF(("WM_*BUTTONDBLCLK for native - default handling\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3705
		 return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3706
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3707
	    goto commonButton;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3708
#else
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3709
	    goto commonButtonDown;
5600
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
  3710
#endif /* PRE_25_AUG_2010 */
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
  3711
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3712
	case WM_LBUTTONDOWN:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3713
	    DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_LBUTTONDOWN h=%x\n", hWnd));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3714
	    curButton = Button1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3715
	    goto commonButtonDown;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3716
	case WM_MBUTTONDOWN:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3717
	    DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_MBUTTONDOWN h=%x\n", hWnd));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3718
	    curButton = Button2;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3719
	    goto commonButtonDown;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3720
	case WM_RBUTTONDOWN:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3721
	    DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_RBUTTONDOWN h=%x\n", hWnd));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3722
	    curButton = Button3;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3723
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3724
	commonButtonDown:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3725
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3726
		NDPRINTF(("WM_*BUTTONDOWN for native - default handling\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3727
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3728
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3729
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3730
	commonButtonWithCapture:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3731
	    if (__currentCapture == CAPTURE_NONE) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3732
		__currentCapture = curButton /*CAPTURE_IMPLICIT*/;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3733
		//SetFocus(hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3734
		SetCapture(hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3735
		CPRINTF(("SetCapture <BUTTONDOWN>%x\n",hWnd));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3736
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3737
	    goto commonButton;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3738
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3739
	commonButton:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3740
	    EVENT_PRINTF3(("WM_BUTTONDOWN h=%x pos=%d/%d\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3741
			   hWnd, LOWORD(lParam), HIWORD(lParam)));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3742
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3743
	    if (GetWindow_eventMask(hWnd) & ButtonPressMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3744
		if (__eatingMouseEvents) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3745
		    __eatingMouseEvents = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3746
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3747
		    enqEvent(ButtonPressMask, hWnd,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3748
			     message, wParam, (UINT)(short)LOWORD(lParam), (INT)(short)HIWORD(lParam),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3749
			     wParam, getModifiers(), evTime);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3750
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3751
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3752
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3753
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3754
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3755
	case WM_CAPTURECHANGED:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3756
	    DPRINTFIF(__debug_WM_FOCUS__ , ("WM_CAPTURECHANGED h=%x to %x\n", hWnd, lParam));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3757
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3758
	    if ((__currentCapture != CAPTURE_NONE) && (__currentCapture != CAPTURE_EXPLICIT))
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3759
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3760
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3761
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3762
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3763
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3764
	case WM_KILLFOCUS:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3765
	    DPRINTFIF(__debug_WM_FOCUS__ , ("WM_KILLFOCUS h=%x\n", hWnd));
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3766
	    // enqEvent(0, hWnd, WM_KILLFOCUS, wParam, 0, 0, 0, 0, EV_NOTIME);
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3767
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3768
		NDPRINTF(("WM_KILLFOCUS for native - default handling\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3769
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3770
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3771
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3772
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3773
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3774
	case WM_SETFOCUS:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3775
	    DPRINTFIF(__debug_WM_FOCUS__ , ("WM_SETFOCUS h=%x\n", hWnd));
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3776
#if 0
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  3777
	    // enqEvent(0,hWnd, WM_SETFOCUS, wParam, 0, 0, 0, 0, EV_NOTIME);
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3778
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3779
		POINT p;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3780
		HWND hWndChild,hWndTemp;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3781
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3782
		p.x = evRootX;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3783
		p.y = evRootY;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3784
		ScreenToClient(hWnd, &p);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3785
		hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3786
		do {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3787
		    hWndTemp = hWndChild;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3788
		    hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3789
		} while ((hWndChild) && (hWndChild != hWndTemp));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3790
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3791
		/*console_printf("WM_ACTIVATE active h=%x p=%d.%d in %x\n", hWnd,p.x,p.y,hWndChild);*/
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3792
		if (hWndChild /*&& (hWndChild != hWnd)*/) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3793
		    if (hWndChild != __currentPointerView) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3794
			int modifiers = getModifiers();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3795
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3796
			if (__currentPointerView) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3797
			    if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3798
				enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3799
				SetWindow_mouseXY(__currentPointerView, -9999, -9999);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3800
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3801
			    __currentPointerView = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3802
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3803
			if (GetWindow_eventMask(hWndChild) & EnterWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3804
			    enqEvent(EnterWindowMask, hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3805
			    SetWindow_mouseXY(hWndChild, evRootX, evRootY);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3806
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3807
			//SetFocus(hWndChild);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3808
			__currentPointerView = hWndChild;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3809
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3810
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3811
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3812
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3813
	    if (isNative) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3814
		NDPRINTF(("WM_SETFOCUS for native - default handling\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3815
		return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3816
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3817
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3818
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3819
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3820
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3821
	case WM_GETTEXT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3822
	    /*EVENT_PRINTF(("WM_GETTEXT %x\n", message));*/
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3823
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3824
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3825
	case WM_GETTEXTLENGTH:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3826
	    EVENT_PRINTF(("WM_GETTEXTLENGTH %x\n", message));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3827
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3828
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3829
	case WM_NCCREATE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3830
	    EVENT_PRINTF(("WM_NCCREATE %x\n", message));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3831
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3832
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3833
	case WM_NCMOUSEMOVE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3834
	    if (__currentCapture == CAPTURE_NONE) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3835
		if (__currentPointerView && (hWnd != __currentPointerView)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3836
		    if (inSizeMove) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3837
			if (needDelayedMouseLeaveWindow == NULL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3838
			    needDelayedMouseLeaveWindow = __currentPointerView;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3839
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3840
		    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3841
			if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3842
			    enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers(), evTime);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3843
			    SetWindow_mouseXY(__currentPointerView, -9999, -9999);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3844
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3845
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3846
		    __currentPointerView = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3847
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3848
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3849
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3850
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3851
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3852
	case WM_PARENTNOTIFY:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3853
	    EVENT_PRINTF2(("WM_PARENTNOTIFY h=%x hChild=%x %d\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3854
				hWnd, lParam, LOWORD(wParam)));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3855
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3856
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3857
	case WM_NCLBUTTONDOWN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3858
	    DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_NCLBUTTONDOWN\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3859
	    if (__shiftedLeftButtonIsLowerWindow) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3860
		/*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3861
		 * with shift, this is a lower-operation
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3862
		 */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3863
		if (GetKeyState(VK_SHIFT) & 0x8000) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3864
		    SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 0, 0,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3865
				 SWP_NOSENDCHANGING |
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3866
				 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3867
		    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3868
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3869
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3870
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3871
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3872
	case WM_NCLBUTTONUP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3873
	    DPRINTFIF(__debug_WM_BUTTONUP__ , ("WM_NCLBUTTONUP\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3874
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3875
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3876
	case WM_NCRBUTTONDOWN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3877
	    DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_NCRBUTTONDOWN\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3878
	    if (__rightButtonIsLowerWindow) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3879
		/*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3880
		 * this is a lower-operation
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3881
		 */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3882
		SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 0, 0,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3883
			     SWP_NOSENDCHANGING |
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3884
			     SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3885
		*pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3886
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3887
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3888
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3889
	case WM_NCRBUTTONUP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3890
	    DPRINTFIF(__debug_WM_BUTTONUP__ , ("WM_NCRBUTTONUP\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3891
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3892
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3893
	case WM_NCMBUTTONDOWN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3894
	    DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_NCMBUTTONDOWN\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3895
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3896
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3897
	case WM_NCMBUTTONUP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3898
	    DPRINTFIF(__debug_WM_BUTTONUP__ , ("WM_NCMBUTTONUP\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3899
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3900
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3901
	case WM_NCLBUTTONDBLCLK:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3902
	    EVENT_PRINTF(("WM_NCLBUTTONDBLCLK\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3903
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3904
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3905
	case WM_NCRBUTTONDBLCLK:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3906
	    EVENT_PRINTF(("WM_NCRBUTTONDBLCLK\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3907
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3908
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3909
	case WM_NCMBUTTONDBLCLK:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3910
	    EVENT_PRINTF(("WM_NCMBUTTONDBLCLK\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3911
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3912
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3913
	case WM_SETTEXT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3914
	    DPRINTFIF(__debug_WM_SETTEXT__ , ("WM_SETTEXT\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3915
	    break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  3916
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
  3917
#ifdef WM_SYNCPAINT
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3918
	case WM_SYNCPAINT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3919
	    EVENT_PRINTF(("WM_SYNCPAINT\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3920
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3921
#else
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3922
	case 0x88:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3923
	    EVENT_PRINTF(("0x88 (undoc)\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3924
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3925
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3926
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3927
	case WM_NCCALCSIZE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3928
	    EVENT_PRINTF(("WM_NCCALCSIZE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3929
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3930
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3931
	case WM_NCPAINT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3932
	    EVENT_PRINTF3(("WM_NCPAINT\n"));
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3933
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3934
#ifdef THIS_DOES_NOT_WORK
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3935
	    /* mhmh - something is drawn, but clipped wrong
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3936
	     * and with wrong colors ....
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3937
	     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3938
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3939
	    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3940
	     * child windows only ...
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3941
	     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3942
	    if (GetParent(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3943
		int clr;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3944
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3945
		clr = GetWindow_bdColor(hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3946
		if (clr != BlackPixel) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3947
		    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3948
		     * draw it here
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3949
		     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3950
		    HBRUSH br;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3951
		    RECT rect, lineRect;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3952
		    HDC hDC;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3953
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3954
		    if (clr == WhitePixel) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3955
			br = __whiteBrush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3956
		    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3957
			br = CreateSolidBrush(clr);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3958
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3959
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3960
		    GetWindowRect(hWnd, &rect);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3961
		    hDC = GetWindowDC(hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3962
		    SelectClipRgn(hDC, NULL);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3963
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3964
		    lineRect.left = rect.left;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3965
		    lineRect.right = rect.right;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3966
		    lineRect.top = rect.top;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3967
		    lineRect.bottom = rect.top + 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3968
		    FillRect(hDC, &lineRect, br);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3969
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3970
		    lineRect.bottom = rect.bottom - 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3971
		    lineRect.bottom = rect.bottom;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3972
		    FillRect(hDC, &lineRect, br);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3973
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3974
		    lineRect.top = rect.top;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3975
		    lineRect.bottom = rect.bottom;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3976
		    lineRect.left = rect.left;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3977
		    lineRect.right = rect.left + 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3978
		    FillRect(hDC, &lineRect, br);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3979
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3980
		    lineRect.left = rect.right - 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3981
		    lineRect.right = rect.right;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3982
		    FillRect(hDC, &lineRect, br);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3983
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3984
		    _DeleteBrush(br, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3985
		    ReleaseDC(hWnd, hDC);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3986
		    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3987
		    return 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3988
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3989
	    }
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  3990
#endif /* THIS_DOES_NOT_WORK */
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3991
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3992
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3993
	case WM_SYSCOMMAND:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3994
	    switch (wParam & ~0x000F) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3995
		case SC_CLOSE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3996
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_CLOSE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3997
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3998
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  3999
		case SC_MOVE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4000
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_MOVE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4001
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4002
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4003
		case SC_RESTORE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4004
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_RESTORE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4005
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4006
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4007
		case SC_SIZE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4008
		    EVENT_PRINTF2(("WM_SYSCOMMAND SC_SIZE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4009
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4010
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4011
		default:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4012
		    EVENT_PRINTF2(("WM_SYSCOMMAND %x\n", wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4013
		    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4014
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4015
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4016
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4017
	case WM_INITMENU:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4018
	    EVENT_PRINTF(("WM_INITMENU\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4019
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4020
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4021
	case WM_INITMENUPOPUP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4022
	    EVENT_PRINTF(("WM_INITMENUPOPUP\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4023
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4024
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4025
	case WM_ENTERIDLE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4026
	    EVENT_PRINTF(("WM_ENTERIDLE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4027
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4028
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4029
	case WM_ENTERMENULOOP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4030
	    EVENT_PRINTF(("WM_ENTERMENULOOP\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4031
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4032
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4033
	case WM_EXITMENULOOP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4034
	    EVENT_PRINTF(("WM_EXITMENULOOP\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4035
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4036
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4037
	case WM_MENUSELECT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4038
	    EVENT_PRINTF(("WM_MENUSELECT\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4039
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4040
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4041
	case WM_QUIT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4042
	    DPRINTF(("quit message hWnd=0x%x lP=0x%x wP=0x%x\n", hWnd, lParam, wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4043
	    enqEvent(0, 0, WM_QUIT, wParam, lParam, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4044
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4045
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4046
	case WM_NCDESTROY:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4047
	    EVENT_PRINTF(("WM_NCDESTROY\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4048
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4049
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4050
	case WM_QUERYNEWPALETTE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4051
	    EVENT_PRINTF(("WM_QUERYNEWPALETTE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4052
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4053
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4054
	case WM_PALETTECHANGED:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4055
	    EVENT_PRINTF(("WM_PALETTECHANGED\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4056
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4057
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4058
	case WM_ACTIVATEAPP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4059
	    EVENT_PRINTF2(("WM_ACTIVATEAPP %s\n", wParam ? "active" : "inactive"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4060
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4061
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4062
	case WM_SYSDEADCHAR:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4063
	    EVENT_PRINTF2(("WM_SYSDEADCHAR %x\n, wParam"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4064
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4065
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4066
	case WM_DEADCHAR:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4067
	    EVENT_PRINTF2(("WM_DEADCHAR %x\n, wParam"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4068
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4069
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4070
	case WM_PAINTICON:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4071
	    EVENT_PRINTF(("WM_PAINTICON\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4072
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4073
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4074
	case WM_ICONERASEBKGND:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4075
	    EVENT_PRINTF(("WM_ICONERASEBKGND\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4076
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4077
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4078
	case WM_WINDOWPOSCHANGING:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4079
	    DPRINTFIF(__debug_WM_WINDOWPOSCHANGING__ , ("WM_WINDOWPOSCHANGING\n"));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4080
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4081
#ifdef HANDLE_VIEWGRAVITY
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4082
	    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4083
	     * any child with a viewGravity ?
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4084
	     * (only care for topViews here;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4085
	     *  child views do it on the smalltalk level ...)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4086
	     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4087
	    if (GetParent(hWnd) == 0) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4088
		if (GetParent(hWnd) == 0) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4089
		    struct gravityCallBackInfo i;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4090
		    RECT rct, dRect;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4091
		    int dW, dH;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4092
		    WINDOWPOS *wp = (WINDOWPOS *)lParam;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4093
		    int winStyleBits, winExStyleBits;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4094
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4095
		    if (! (wp->flags & SWP_NOSIZE)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4096
			dRect.left = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4097
			dRect.top = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4098
			dRect.right = 100;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4099
			dRect.bottom = 100;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4100
			winStyleBits = GetWindowLong(hWnd, GWL_STYLE);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4101
			winExStyleBits = GetWindowLong(hWnd, GWL_EXSTYLE);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4102
			AdjustWindowRectEx(&dRect, winStyleBits, 0, winExStyleBits);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4103
			dW = dRect.right - dRect.left;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4104
			dH = dRect.bottom - dRect.top;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4105
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4106
			GetClientRect(hWnd, &rct);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4107
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4108
			i.parent = hWnd;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4109
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4110
			i.currW = rct.right - rct.left;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4111
			i.currH = rct.bottom - rct.top;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4112
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4113
			/* wp gives us the new outer (frame) bounds */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4114
			i.newW = wp->cx - (dW - 100);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4115
			i.newH = wp->cy - (dH - 100);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4116
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4117
			if ((i.currW != i.newW)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4118
			 || (i.currH != i.newH)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4119
			    DPRINTF((stderr, "about to sizeChange old: %d/%d new: %d/%d\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4120
				    i.currW, i.currH, i.newW, i.newH));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4121
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4122
			    GetWindowRect(hWnd, &rct);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4123
			    i.parentWinX = rct.left - dRect.left;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4124
			    i.parentWinY = rct.top - dRect.top;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4125
			    EnumChildWindows(hWnd, gravityEnumeratorCallBack, (int)(&i));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4126
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4127
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4128
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4129
	    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4130
#endif /* HANDLE_VIEWGRAVITY */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4131
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4132
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4133
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4134
	case WM_QUERYOPEN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4135
	    EVENT_PRINTF(("WM_QUERYOPEN\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4136
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4137
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4138
	case WM_QUERYENDSESSION:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4139
	    EVENT_PRINTF(("WM_QUERYENDSESSION\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4140
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4141
	    if (@global(CanEndSession) == false) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4142
		enqEvent(0, hWnd, WM_QUERYENDSESSION, wParam, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4143
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4144
		// TODO: enter new event loop
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4145
		// which is left when an endSessionConfirmation
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4146
		// arrives from smalltalk
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4147
		// (either positive or negative).
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4148
		// for now, do not allow leaving
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4149
		// windows as long as ST/X is open.
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4150
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4151
		return(0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4152
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4153
	    return(TRUE);  // allow leaving windows
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4154
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4155
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4156
	case WM_ENDSESSION:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4157
	    EVENT_PRINTF(("WM_ENDSESSION\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4158
	    enqEvent(0, hWnd, WM_ENDSESSION, wParam, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4159
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4160
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4161
	case WM_DISPLAYCHANGE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4162
	    EVENT_PRINTF(("WM_DISPLAYCHANGE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4163
	    enqEvent(0, hWnd, WM_DISPLAYCHANGE, wParam, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4164
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4165
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4166
	case WM_FONTCHANGE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4167
	    EVENT_PRINTF(("WM_FONTCHANGE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4168
	    enqEvent(0, hWnd, WM_FONTCHANGE, wParam, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4169
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4170
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4171
	case WM_WININICHANGE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4172
	    EVENT_PRINTF(("WM_WININICHANGE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4173
	    enqEvent(0, hWnd, WM_WININICHANGE, wParam, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4174
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4175
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4176
	case WM_SYSCOLORCHANGE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4177
	    EVENT_PRINTF(("WM_SYSCOLORCHANGE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4178
	    enqEvent(0, hWnd, WM_SYSCOLORCHANGE, wParam, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4179
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4180
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4181
	case WM_MOVING:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4182
	    DPRINTFIF(__debug_WM_MOVING__ , ("WM_MOVING\n"));
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4183
#ifdef DELAY_ENTER_LEAVE_WHILE_IN_SIZE_MOVE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4184
	    inMove = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4185
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4186
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4187
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4188
	case WM_SIZING:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4189
	    EVENT_PRINTF(("WM_SIZING\n"));
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4190
#ifdef DELAY_ENTER_LEAVE_WHILE_IN_SIZE_MOVE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4191
	    inSize = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4192
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4193
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4194
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4195
	case WM_ENTERSIZEMOVE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4196
	    EVENT_PRINTF(("WM_ENTERSIZEMOVE\n"));
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  4197
#ifdef DELAY_ENTER_LEAVE_WHILE_IN_SIZE_MOVE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4198
	    inSizeMove = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4199
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4200
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4201
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4202
	case WM_EXITSIZEMOVE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4203
	    EVENT_PRINTF(("WM_EXITSIZEMOVE\n"));
4155
b557b9991c9c inform STX about WINDOWPOSCHANGED in EXITSIZEMOVE (not during moving)
ca
parents: 4154
diff changeset
  4204
b557b9991c9c inform STX about WINDOWPOSCHANGED in EXITSIZEMOVE (not during moving)
ca
parents: 4154
diff changeset
  4205
#ifndef PRE_13_APR_04_POSCHANGED_IN_EXITSIZEMOVE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4206
	    if (inMove) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4207
		/* generate WM_WINDOWPOSCHANGED
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4208
		*/
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4209
		RECT rct;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4210
		int x, y, w, h;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4211
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4212
		GetClientRect(hWnd, &rct);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4213
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4214
		x = rct.left;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4215
		y = rct.top;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4216
		w = rct.right - rct.left;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4217
		h = rct.bottom - rct.top;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4218
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4219
		if ((w == 0) && (h == 0)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4220
		    if (! GetWindow_iconified(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4221
			SetWindow_iconified(hWnd, 1);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4222
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4223
		    enqEvent(0, hWnd, __WM_ICONIFIED, 1, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4224
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4225
		    if (GetWindow_iconified(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4226
			SetWindow_iconified(hWnd, 0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4227
			enqEvent(0, hWnd, __WM_ICONIFIED, 0, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4228
		    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4229
			enqEvent(0, hWnd, WM_WINDOWPOSCHANGED, 0, x, y, w, h, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4230
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4231
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4232
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4233
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4234
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4235
	    inSizeMove = inMove = inSize = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4236
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4237
	    if (needDelayedMouseLeaveWindow || needDelayedMouseEnterWindow) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4238
		int modifiers = getModifiers();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4239
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4240
		if (needDelayedMouseLeaveWindow) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4241
		    if (GetWindow_eventMask(needDelayedMouseLeaveWindow) & LeaveWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4242
			enqEvent(LeaveWindowMask, needDelayedMouseLeaveWindow, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4243
			SetWindow_mouseXY(needDelayedMouseLeaveWindow, -9999, -9999);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4244
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4245
		    needDelayedMouseLeaveWindow = NULL;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4246
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4247
		if (needDelayedMouseEnterWindow) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4248
		    if (GetWindow_eventMask(needDelayedMouseEnterWindow) & EnterWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4249
			enqEvent(EnterWindowMask, needDelayedMouseEnterWindow, __WM_MOUSEENTER, 0, delayedMouseEnterX, delayedMouseEnterY, 0, modifiers, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4250
			SetWindow_mouseXY(needDelayedMouseEnterWindow, delayedMouseEnterX, delayedMouseEnterY);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4251
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4252
		    needDelayedMouseEnterWindow = NULL;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4253
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4254
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4255
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4256
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4257
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4258
	case WM_MOVE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4259
	    EVENT_PRINTF(("WM_MOVE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4260
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4261
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4262
	case WM_POWER:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4263
	    EVENT_PRINTF(("WM_POWER\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4264
	    enqEvent(0, hWnd, WM_POWER, wParam, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4265
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4266
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4267
	/* native widget actions */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4268
	case WM_COMMAND:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4269
	    if (lParam) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4270
		NDPRINTF(("COMMAND for widget\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4271
		enqEvent(0, (HWND)(lParam), WM_COMMAND, wParam, lParam, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4272
	    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4273
		NDPRINTF(("COMMAND for owner\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4274
		enqEvent(0, hWnd, WM_COMMAND, wParam, lParam, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4275
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4276
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4277
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4278
	/* tray action */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4279
	case WM_TRAY_MESSAGE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4280
	    DPRINTF(("tray message hWnd=0x%x lP=0x%x wP=0x%x\n", hWnd, lParam, wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4281
	    enqEvent(0, hWnd, WM_TRAY_MESSAGE, wParam, lParam, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4282
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4283
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4284
	case WM_COPYDATA:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4285
	    DPRINTFIF(__debug_WM_COPYDATA__ , ("WM_COPYDATA\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4286
	    {
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4287
		PCOPYDATASTRUCT pCDs = (PCOPYDATASTRUCT) lParam;
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4288
		int dwData = pCDs->dwData;
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4289
		int nBytes = pCDs->cbData;
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4290
		void *pData = pCDs->lpData;
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4291
		void *pCopiedData;
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4292
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4293
		DPRINTFIF(__debug_WM_COPYDATA__ , ("WM_COPYDATA %d %lx\n", nBytes, pData));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4294
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4295
		/*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4296
		 * because pData is only valid here, copy it out to a malloc'd
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4297
		 * area. This MUST be free'd by someone else !
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4298
		 */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4299
		if (nBytes) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4300
		    pCopiedData = malloc(nBytes);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4301
		    memcpy(pCopiedData, pData, nBytes);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4302
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4303
		    pCopiedData = NULL;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4304
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4305
		//     (flag, hWnd, message, wParam, arg1, arg2, arg3, arg4, evTime)
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4306
		enqEvent(0, hWnd, WM_COPYDATA, wParam, (INT)pCopiedData, nBytes, dwData, 0, EV_NOTIME);
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4307
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4308
	    *pDefault = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4309
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4310
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4311
	case WM_HSCROLL:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4312
	case WM_VSCROLL:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4313
	    NDPRINTF(("VM_*SCROLL\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4314
	    enqEvent(0, hWnd, message, wParam, lParam, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4315
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4316
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4317
	case WM_DRAWITEM:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4318
	    EVENT_PRINTF(("WM_DRAWITEM\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4319
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4320
	    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4321
		DRAWITEMSTRUCT *pItemStruct;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4322
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4323
		pItemStruct = (DRAWITEMSTRUCT *)lParam;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4324
		enqEvent(0, pItemStruct->hwndItem, WM_DRAWITEM, wParam, 0, 0, 0, 0, EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4325
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4326
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4327
	    break;
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
  4328
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
  4329
#ifdef TRACE_ALL_EVENTS
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4330
	case WM_CTLCOLORMSGBOX:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4331
	    UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORMSGBOX\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4332
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4333
	case WM_CTLCOLOREDIT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4334
	    UNHANDLED_EVENT_PRINTF(("WM_CTLCOLOREDIT\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4335
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4336
	case WM_CTLCOLORLISTBOX:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4337
	    UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORLISTBOX\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4338
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4339
	case WM_CTLCOLORBTN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4340
	    UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORBTN\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4341
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4342
	case WM_CTLCOLORDLG:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4343
	    UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORDLG\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4344
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4345
	case WM_CTLCOLORSTATIC:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4346
	    UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORSTATIC\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4347
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4348
	case WM_CTLCOLORSCROLLBAR:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4349
	    UNHANDLED_EVENT_PRINTFIF(__debug_WM_CTLCOLORSCROLLBAR__, ("WM_CTLCOLORSCROLLBAR\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4350
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4351
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4352
	case WM_STYLECHANGING:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4353
	    UNHANDLED_EVENT_PRINTF(("WM_STYLECHANGING\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4354
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4355
	case WM_STYLECHANGED:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4356
	    UNHANDLED_EVENT_PRINTF(("WM_STYLECHANGED\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4357
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4358
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4359
	case WM_GETICON:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4360
	    UNHANDLED_EVENT_PRINTFIF(__debug_WM_GETICON__, ("WM_GETICON\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4361
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4362
	case WM_SETICON:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4363
	    UNHANDLED_EVENT_PRINTF(("WM_SETICON\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4364
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4365
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4366
	case WM_PRINT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4367
	    UNHANDLED_EVENT_PRINTF(("WM_PRINT(lParam=%d)\n", lParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4368
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4369
	case WM_PRINTCLIENT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4370
	    UNHANDLED_EVENT_PRINTF(("WM_PRINTCLIENT(lParam=%d)\n", lParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4371
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4372
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4373
	case WM_NULL:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4374
	    UNHANDLED_EVENT_PRINTF(("WM_NULL\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4375
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4376
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4377
	case WM_ENABLE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4378
	    UNHANDLED_EVENT_PRINTF(("WM_ENABLE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4379
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4380
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4381
	case WM_SETREDRAW:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4382
	    UNHANDLED_EVENT_PRINTF(("WM_SETREDRAW\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4383
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4384
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4385
	case WM_DEVMODECHANGE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4386
	    UNHANDLED_EVENT_PRINTF(("WM_DEVMODECHANGE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4387
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4388
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4389
	case WM_TIMECHANGE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4390
	    UNHANDLED_EVENT_PRINTF(("WM_TIMECHANGE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4391
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4392
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4393
	case WM_CANCELMODE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4394
	    UNHANDLED_EVENT_PRINTF(("WM_CANCELMODE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4395
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4396
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4397
	case WM_CHILDACTIVATE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4398
	    UNHANDLED_EVENT_PRINTF(("WM_CHILDACTIVATE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4399
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4400
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4401
	case WM_QUEUESYNC:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4402
	    UNHANDLED_EVENT_PRINTF(("WM_QUEUESYNC\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4403
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4404
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4405
	case WM_NEXTDLGCTL:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4406
	    UNHANDLED_EVENT_PRINTF(("WM_NEXTDLGCTL\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4407
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4408
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4409
	case WM_SPOOLERSTATUS:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4410
	    UNHANDLED_EVENT_PRINTF(("WM_SPOOLERSTATUS\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4411
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4412
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4413
	case WM_MEASUREITEM:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4414
	    UNHANDLED_EVENT_PRINTF(("WM_MEASUREITEM\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4415
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4416
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4417
	case WM_DELETEITEM:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4418
	    UNHANDLED_EVENT_PRINTF(("WM_DELETEITEM\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4419
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4420
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4421
	case WM_VKEYTOITEM:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4422
	    UNHANDLED_EVENT_PRINTF(("WM_VKEYTOITEM\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4423
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4424
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4425
	case WM_CHARTOITEM:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4426
	    UNHANDLED_EVENT_PRINTF(("WM_CHARTOITEM\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4427
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4428
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4429
	case WM_SETFONT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4430
	    UNHANDLED_EVENT_PRINTF(("WM_SETFONT\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4431
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4432
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4433
	case WM_GETFONT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4434
	    UNHANDLED_EVENT_PRINTF(("WM_GETFONT\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4435
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4436
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4437
	case WM_SETHOTKEY:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4438
	    UNHANDLED_EVENT_PRINTF(("WM_SETHOTKEY\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4439
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4440
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4441
	case WM_GETHOTKEY:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4442
	    UNHANDLED_EVENT_PRINTF(("WM_GETHOTKEY\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4443
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4444
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4445
	case WM_QUERYDRAGICON:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4446
	    UNHANDLED_EVENT_PRINTF(("WM_QUERYDRAGICON\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4447
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4448
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4449
	case WM_COMPAREITEM:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4450
	    UNHANDLED_EVENT_PRINTF(("WM_COMPAREITEM\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4451
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4452
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4453
	case WM_GETOBJECT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4454
	    UNHANDLED_EVENT_PRINTF(("WM_GETOBJECT\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4455
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4456
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4457
	case WM_COMPACTING:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4458
	    UNHANDLED_EVENT_PRINTF(("WM_COMPACTING\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4459
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4460
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4461
	case WM_COMMNOTIFY:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4462
	    UNHANDLED_EVENT_PRINTF(("WM_COMMNOTIFY\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4463
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4464
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4465
	case WM_CANCELJOURNAL:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4466
	    UNHANDLED_EVENT_PRINTF(("WM_CANCELJOURNAL\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4467
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4468
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4469
	case WM_INPUTLANGCHANGEREQUEST:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4470
	    UNHANDLED_EVENT_PRINTF(("WM_INPUTLANGCHANGEREQUEST\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4471
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4472
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4473
	case WM_INPUTLANGCHANGE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4474
	    UNHANDLED_EVENT_PRINTF(("WM_INPUTLANGCHANGE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4475
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4476
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4477
	case WM_TCARD:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4478
	    UNHANDLED_EVENT_PRINTF(("WM_TCARD\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4479
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4480
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4481
	case WM_HELP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4482
	    UNHANDLED_EVENT_PRINTF(("WM_HELP\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4483
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4484
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4485
	case WM_USERCHANGED:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4486
	    UNHANDLED_EVENT_PRINTF(("WM_USERCHANGED\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4487
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4488
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4489
	case WM_NOTIFY:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4490
	    UNHANDLED_EVENT_PRINTF(("WM_NOTIFY\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4491
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4492
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4493
	case WM_NOTIFYFORMAT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4494
	    UNHANDLED_EVENT_PRINTF(("WM_NOTIFYFORMAT\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4495
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4496
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4497
	case WM_CONTEXTMENU:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4498
	    UNHANDLED_EVENT_PRINTF(("WM_CONTEXTMENU\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4499
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4500
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4501
	case WM_NCXBUTTONDOWN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4502
	    UNHANDLED_EVENT_PRINTF(("WM_NCXBUTTONDOWN\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4503
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4504
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4505
	case WM_NCXBUTTONUP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4506
	    UNHANDLED_EVENT_PRINTF(("WM_NCXBUTTONUP\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4507
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4508
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4509
	case WM_NCXBUTTONDBLCLK:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4510
	    UNHANDLED_EVENT_PRINTF(("WM_NCXBUTTONDBLCLK\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4511
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4512
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4513
	case WM_DEVICECHANGE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4514
	    UNHANDLED_EVENT_PRINTF(("WM_DEVICECHANGE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4515
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4516
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  4517
	case DBT_DEVICEARRIVAL:
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  4518
	    UNHANDLED_EVENT_PRINTF(("DBT_DEVICEARRIVAL\n"));
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  4519
	    break;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  4520
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  4521
	case DBT_DEVICEREMOVECOMPLETE:
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  4522
	    UNHANDLED_EVENT_PRINTF(("DBT_DEVICEREMOVECOMPLETE\n"));
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  4523
	    break;
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4524
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4525
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4526
	default:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4527
	    EVENT_PRINTF(( "WinWorkstat [info] unhandled msg = %d 0x%x [%d]\n", message, message, __LINE__));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4528
	    break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4529
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4530
    return 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4531
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4532
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4533
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4534
static void _USERENTRY
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4535
dispatchThread(void *arg)
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4536
{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4537
    static int th_calls;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4538
    RECT rect;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4539
    MSG msg;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4540
    localWindowInfo *lI;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4541
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4542
    _dispatchThreadId2 = GetCurrentThreadId();
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4543
#ifdef STARTUP_DISPATCHTHREAD_DEBUG
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  4544
    console_fprintf(stderr, "WinWorkstation [info]: dispatchThreadID2=%x\n", _dispatchThreadId2);
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4545
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4546
    TH_DPRINTF(("TS %d\n", th_calls++));
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  4547
    PeekMessageW(&msg, NULL, 0, 0, PM_NOREMOVE);   /* must be */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4548
4444
8d6a48c51edc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  4549
#if 0
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4550
    if (AttachThreadInput(_masterThreadId, _dispatchThreadId2, TRUE) != TRUE) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4551
	console_fprintf(stderr, "WinWorkstation [warning]: AttachThreadInput failed\n");
4443
96e956cf9acf plugin stuff now in librun
Claus Gittinger <cg@exept.de>
parents: 4441
diff changeset
  4552
    };
4444
8d6a48c51edc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4443
diff changeset
  4553
#endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4554
#ifndef WIN32THREADS
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4555
# if 0
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4556
    SetThreadPriority(_masterThread,THREAD_PRIORITY_HIGHEST);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4557
    SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_ABOVE_NORMAL);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4558
# endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4559
#endif
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  4560
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4561
    GetWindowRect(GetDesktopWindow(), &rect);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4562
    /* allocate localMemory for Window */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4563
    lI = (localWindowInfo *)malloc(sizeof(localWindowInfo));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  4564
    if (lI) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4565
	memset(lI, 0, sizeof(*lI));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4566
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  4567
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  4568
    __rootWinSpezial = CreateWindowExW(WS_EX_TOOLWINDOW | WS_EX_TRANSPARENT,
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4569
				      wapp_nameRoot, wapp_nameRoot,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4570
				      WS_POPUP | WS_DISABLED,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4571
				      0, 0,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4572
				      rect.right - rect.left, rect.bottom - rect.top,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4573
				      0, 0, (HANDLE) __getHInstance(), lI);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4574
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
  4575
    //ShowWindow(__rootWinSpezial,SW_SHOWNOACTIVATE);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  4576
    SetWindowPos(__rootWinSpezial, HWND_BOTTOM, 0, 0, 0, 0,
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4577
		 SWP_NOSENDCHANGING |
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4578
		 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4579
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4580
#ifdef STARTUP_DISPATCHTHREAD_DEBUG
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  4581
    console_fprintf(stderr, "WinWorkstation [info]: setting ThreadRunningEvent\n");
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4582
#endif
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
  4583
    SetEvent(hDispatchThreadRunningEvent);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4584
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4585
    for (;;) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4586
	HANDLE dummy;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4587
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4588
	TH_DPRINTF(("TG %d\n", th_calls++));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4589
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4590
	/*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4591
	 * if there is no current capture (pointer-grab),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4592
	 * make certain that we do not get stuck in the GetMessage
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4593
	 * but instead poll the mouse in 200ms intervals.
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4594
	 * This is required to synthesize the MOUSELEAVE message,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4595
	 */
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  4596
// DPRINTF(("X1\n"));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4597
	if (__currentPointerView && (__currentCapture == CAPTURE_NONE)) {
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  4598
// DPRINTF(("X2\n"));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4599
	    while (PeekMessageW(&msg, 0, 0, 0, PM_NOREMOVE) == 0) {
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  4600
// DPRINTF(("PeekMessage -> 0\n"));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4601
		/*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4602
		 * wait for an event; timeout after 200 millis
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4603
		 */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4604
		if (MsgWaitForMultipleObjects(0,&dummy,FALSE,200,QS_ALLINPUT) == WAIT_TIMEOUT) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4605
		    if (! inSizeMove) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4606
			/*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4607
			 * timeout - see where mouse pointer is
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4608
			 * for synthetic leave events.
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4609
			 */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4610
			POINT point;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4611
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4612
			if (GetCursorPos(&point)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4613
			    HWND hWnd = WindowFromPoint(point);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4614
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4615
			    if (hWnd) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4616
				if (GetWindowThreadProcessId(hWnd,0) != GetCurrentThreadId()) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4617
				    if (inSizeMove) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4618
					if (needDelayedMouseLeaveWindow == NULL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4619
					    needDelayedMouseLeaveWindow = __currentPointerView;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4620
					}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4621
				    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4622
					if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4623
					    enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers(), EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4624
					    SetWindow_mouseXY(__currentPointerView, -9999, -9999);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4625
					}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4626
				    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4627
				    __currentPointerView = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4628
				    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4629
				}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4630
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4631
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4632
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4633
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4634
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4635
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4636
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4637
	GetMessageW(&msg, NULL, 0, 0);
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  4638
// DPRINTF(("GetMessage -> %d\n", msg.message));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4639
	TH_DPRINTF(("TD %d\n", th_calls++));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4640
	destroyWin = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4641
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4642
	switch (msg.message) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4643
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4644
	    case WM_THREAD_DESTROYWINDOW:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4645
		destroyWin = TRUE;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4646
		msg.message = WM_CLOSE;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4647
		EVENT_PRINTF(("thread WM_THREAD_DESTROYWINDOW %x\n",msg.hwnd));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4648
		break;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4649
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4650
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4651
#ifdef SET_FOCUS_IN_WINTHREAD
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4652
	    case WM_THREAD_SETFOCUS:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  4653
		DPRINTFIF(__debug_WM_FOCUS__ , ("WM_THREAD_SETFOCUS h=%x\n", msg.wParam));
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4654
# ifdef xxWIN32THREADS
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4655
		if (msg.lParam) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4656
		    if (AttachThreadInput(_dispatchThreadId2,msg.lParam,TRUE) == FALSE)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4657
			PRINTF(("SetFocus AttachThreadInput error %d\n", GetLastError()));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4658
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4659
# endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4660
		EVENT_PRINTF(("threadSetfocus %x\n",msg.wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4661
		if (SetFocus((HWND)msg.wParam) == 0) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4662
		    DDPRINTF(("SetFocus to %x failed.\n",msg.wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4663
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4664
		continue;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4665
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4666
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4667
#ifdef SET_CURSOR_IN_WINTHREAD
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4668
	    case WM_THREAD_SETCURSOR:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4669
		if (msg.lParam) {
5517
3581c9a93da6 Remove obsolete win95 stuff
Stefan Vogel <sv@exept.de>
parents: 5515
diff changeset
  4670
#if 1
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4671
		    SetCursor((HCURSOR)msg.lParam);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4672
#else
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4673
		    /* this check is done by our sender */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4674
		    {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4675
			POINT p;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4676
			GetCursorPos(&p);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4677
			if (WindowFromPoint(p) == msg.hwnd) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4678
			    EVENT_PRINTF(("threadSetCursor %x\n",msg.lParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4679
			    SetCursor((HCURSOR)msg.lParam);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4680
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4681
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4682
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4683
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4684
		continue;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  4685
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  4686
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  4687
#ifdef BEEP_IN_WINTHREAD
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4688
	    case WM_THREAD_BEEP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4689
		MessageBeep( MB_ICONEXCLAMATION);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4690
		continue;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4691
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4692
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4693
	    case WM_THREAD_SETCAPTURE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4694
		if (msg.wParam) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4695
		    if (__currentPointerView) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4696
			if (inSizeMove) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4697
			    if (needDelayedMouseLeaveWindow == NULL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4698
				needDelayedMouseLeaveWindow = __currentPointerView;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4699
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4700
			} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4701
			    if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4702
				enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers(), EV_NOTIME);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4703
				SetWindow_mouseXY(__currentPointerView, -9999, -9999);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4704
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4705
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4706
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4707
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4708
		    __currentPointerView = (HWND)msg.wParam;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4709
		    __currentCapture = CAPTURE_EXPLICIT;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4710
		    EVENT_PRINTF(("threadSetCapture %x\n",msg.wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4711
		    SetCapture(__currentPointerView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4712
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4713
		    if (__currentPointerView  == __rootWinSpezial) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4714
			//ShowWindow(__rootWinSpezial, SW_HIDE);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4715
			SetWindowPos(__rootWinSpezial, HWND_BOTTOM, 0, 0, 0, 0,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4716
				     SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4717
				     | SWP_HIDEWINDOW | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4718
				   /*| SWP_NOZORDER | SWP_NOOWNERZORDER */);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4719
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4720
		    __currentPointerView = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4721
		    __currentCapture = CAPTURE_NONE;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4722
		    EVENT_PRINTF(("threadReleaseCapture\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4723
		    ReleaseCapture();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4724
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4725
		if (msg.lParam) {
6165
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  4726
		    DDDDPRINTF(("threadSetCursor %x\n",msg.lParam));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4727
		    SetCursor((HCURSOR)msg.lParam);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4728
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4729
		continue;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4730
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4731
	    case WM_THREAD_CREATEWINDOW:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4732
		EVENT_PRINTF(("*WM_THREAD_CREATEWINDOW %d\n", th_calls));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4733
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4734
		{
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4735
		    createWindowInfo *cwi = (createWindowInfo *)(msg.lParam);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4736
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4737
		    if ((cwi->sequenceNr == msg.wParam)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4738
		     && (cwi->sequenceNr != INVALIDATED_CWI)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4739
			cwi->sequenceNr = INVALIDATED_CWI;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4740
			cwi->infoWasRead = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4741
			if (cwi->newWinHandle == NULL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4742
			    HANDLE ev;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4743
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4744
			    cwi->newWinHandle = CreateWindowExW(
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4745
						cwi->winStyleBitsEx,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4746
						cwi->className,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4747
						cwi->windowName,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4748
						cwi->winStyleBits,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4749
						cwi->x, cwi->y,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4750
						cwi->dx, cwi->dy,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4751
						cwi->parentHandle,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4752
						NULL,           /* menu */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4753
						(HANDLE) __getHInstance(),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4754
						cwi->localWindowInfo
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4755
					       );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4756
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4757
			    if (cwi->newWinHandle == NULL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4758
				cwi->errCode = GetLastError();
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4759
				console_fprintf(stderr, "WinWorkstation [info]: CreateWindow %s failed: %d (0x%x) [%d]\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4760
						cwi->className, cwi->errCode, cwi->errCode, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4761
			    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4762
				SETLOCALWINDOWINFOPTR(cwi->newWinHandle, cwi->localWindowInfo);
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  4763
#ifdef DEBUG /* PARANOIA */
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4764
				if (GETLOCALWINDOWINFOPTR(cwi->newWinHandle) != cwi->localWindowInfo) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4765
				   console_fprintf(stderr, "lI-Error\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4766
				}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4767
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4768
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4769
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4770
			    ev = cwi->hCreateEvent;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4771
			    if (ev) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4772
				SetEvent(ev);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4773
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4774
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4775
		    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4776
			DPRINTF(("obsolete createWindow message %x ignored\n", cwi->sequenceNr));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4777
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4778
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4779
		continue;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4780
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4781
	    case WM_THREAD_REGISTERHOTKEY:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4782
		EVENT_PRINTF(("*WM_THREAD_REGISTERHOTKEY\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4783
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4784
		{
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4785
		    registerHotKeyInfo *rhki = (registerHotKeyInfo *)(msg.lParam);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4786
		    if (!RegisterHotKey(rhki->hwnd,rhki->hotKeyId,rhki->modifier,rhki->virtualKey)){
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4787
			console_fprintf(stderr, "WinWorkstation [error]: RegisterHotKey failed: err=%d\n", GetLastError() );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4788
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4789
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4790
		continue;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4791
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4792
	    case WM_THREAD_UNREGISTERHOTKEY:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4793
		EVENT_PRINTF(("*WM_THREAD_UNREGISTERHOTKEY\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4794
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4795
		{
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4796
		    registerHotKeyInfo *rhki = (registerHotKeyInfo *)(msg.lParam);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4797
		    if (!UnregisterHotKey(rhki->hwnd,rhki->hotKeyId)){
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4798
			console_fprintf(stderr, "WinWorkstation [error]: UnegisterHotKey failed: err=%d\n", GetLastError() );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4799
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4800
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4801
		continue;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4802
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4803
	    case WM_KEYDOWN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4804
		DPRINTFIF(__debug_WM_KEYDOWN__ , ("WM_KEYDOWN %x\n", msg.wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4805
		goto commonKey;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4806
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4807
	    case WM_KEYUP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4808
		DPRINTFIF(__debug_WM_KEYUP__  , ("WM_KEYUP %x\n", msg.wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4809
		goto commonKey;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4810
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4811
	    case WM_SYSKEYDOWN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4812
		DPRINTFIF(__debug_WM_KEYDOWN__ , ("WM_SYSKEYDOWN %x\n", msg.wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4813
		goto commonKey;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4814
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4815
	    case WM_SYSKEYUP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4816
		DPRINTFIF(__debug_WM_KEYUP__ , ("WM_SYSKEYUP %x\n", msg.wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4817
		goto commonKey;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4818
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4819
	    case WM_HOTKEY:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4820
		// console_fprintf(stderr, "dispatchThread [info]: receive hotkey %x %x\n", msg.hwnd, msg.wParam);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4821
		DPRINTFIF(__debug_WM_KEYUP__ , ("WM_HOTKEY %x\n", msg.wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4822
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4823
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4824
	    commonKey:
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
  4825
#if 1
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4826
		if (((msg.wParam >= '0') && (msg.wParam <= 'Z'))
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4827
		 || ((msg.wParam >= VK_MULTIPLY) && (msg.wParam <= VK_DIVIDE))
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4828
		 || (msg.wParam == VK_SPACE)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4829
		 || (msg.wParam == VK_CAPITAL)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4830
		 /* || (msg.wParam == VK_SHIFT) */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4831
		 || (msg.wParam >= 0xB0))
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4832
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4833
		{
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4834
		    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4835
		     * translate to a WM_CHAR message
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4836
		     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4837
		    if (TranslateMessage(&msg))
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4838
			continue;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4839
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4840
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4841
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4842
	    /* short cirquit some messages */
3574
db1360ba8dea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3573
diff changeset
  4843
#if 0
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  4844
# ifndef SUPPORT_NATIVE_WINDOWS
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4845
	    /*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4846
	     * some can simply be ignored ...
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4847
	     */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4848
	    case WM_ERASEBKGND:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4849
		EVENT_PRINTF(("*WM_ERASEBKGND\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4850
		continue;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4851
	    case WM_KILLFOCUS:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4852
		EVENT_PRINTF(("*WM_KILLFOCUS\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4853
		continue;
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  4854
# endif
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4855
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4856
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4857
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4858
	    case WM_SIZE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4859
		EVENT_PRINTF(("*WM_SIZE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4860
		continue;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4861
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4862
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4863
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4864
	/*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4865
	 * common ...
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4866
	 */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4867
	evRootX = msg.pt.x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4868
	evRootY = msg.pt.y;
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  4869
#if 1
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4870
	{
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4871
	    POINT p;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4872
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4873
	    if (GetCursorPos(&p)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4874
		evRootX = p.x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4875
		evRootY = p.y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4876
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4877
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4878
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4879
	lastMSGTime = msg.time;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4880
	DispatchMessageW(&msg);   /* Dispatches message to window */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4881
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4882
}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4883
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4884
LONG APIENTRY
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  4885
MainWndProc(HWND hWnd, UINT message, UINT wParam, LONG lParam)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4886
{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4887
    int wantDefault = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4888
    int retVal;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4889
    createWindowInfo *cwi;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4890
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  4891
    TH_DPRINTF(("TMW %d\n",message));
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  4892
    EVENT_PRINTF3(("MainWndProc %d\n",message));
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4893
    /*
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4894
     * kludge while in sizeMove loop, which
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4895
     * is performed directly by DefWindowProc
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  4896
     * 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
  4897
     * 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
  4898
     */
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
  4899
    cwi = pendingCREATEWINDOWInfo;
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
  4900
    if (cwi) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4901
	int dummyWantDefault;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4902
	int seqNr = pendingSequenceNr;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4903
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4904
	pendingCREATEWINDOWInfo = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4905
	pendingSequenceNr = INVALIDATED_CWI;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4906
	DPRINTF(("### THREAD_CREATEWINDOW\n"));
6067
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
  4907
	winEventProcessing(0, WM_THREAD_CREATEWINDOW, seqNr, (INT)cwi, &dummyWantDefault);
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4908
    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  4909
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4910
    retVal = winEventProcessing(hWnd, message, wParam, lParam, &wantDefault);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4911
    if (wantDefault) {
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  4912
	DDDPRINTF((">>DefWindowProc\n"));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4913
	retVal = DefWindowProcW(hWnd, message, wParam, lParam);
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  4914
	DDDPRINTF(("<<DefWindowProc\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4915
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4916
    return retVal;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  4917
}
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4918
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  4919
static int CALLBACK
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  4920
EnumWindowsProc(HWND hwnd, LPARAM lParam)
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4921
{
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4922
	volatile OBJ *refToCollection;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4923
	OBJ collection;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4924
	OBJ wHandle;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4925
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4926
	if (hwnd) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4927
	    refToCollection = (OBJ*) lParam;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4928
	    __PROTECT__(*refToCollection);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4929
	    wHandle = __MKEXTERNALADDRESS(hwnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4930
	    __UNPROTECT__(*refToCollection);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4931
	    collection = *refToCollection;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4932
	    __SSEND1( collection, @symbol(add:), 0, wHandle );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4933
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4934
	return TRUE;
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4935
}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4936
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4937
#ifdef USE_EnumFontFamiliesEx
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4938
# define LOGFONTTYPE  ENUMLOGFONTEX
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4939
#else
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4940
# define LOGFONTTYPE  LOGFONT
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4941
#endif
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4942
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
  4943
static int CALLBACK
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4944
EnumFPTypeFaceProc(
7614
3c353f6799d5 fix prev change
Stefan Vogel <sv@exept.de>
parents: 7613
diff changeset
  4945
    const LOGFONTTYPE *lplf,   /* ptr to of logical-font data */
3c353f6799d5 fix prev change
Stefan Vogel <sv@exept.de>
parents: 7613
diff changeset
  4946
    const TEXTMETRIC  *lptm,   /* ptr to physical font data */
7613
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
  4947
    DWORD dwType,              /* font type */
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
  4948
    LPARAM lpData              /* application supplied data */
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  4949
) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4950
	OBJ t;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4951
	volatile OBJ *refToList;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4952
	OBJ  typeFaceList;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4953
	char *faceNameString;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4954
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4955
	if (lplf) {
7613
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
  4956
	    refToList = (OBJ *) lpData;
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4957
	    __PROTECT__(*refToList);
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4958
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4959
#ifdef USE_EnumFontFamiliesEx
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4960
	    faceNameString = lplf->elfLogFont.lfFaceName;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4961
#else
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4962
	    faceNameString = lplf->lfFaceName;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4963
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4964
	    t = __MKSTRING( faceNameString );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4965
	    __UNPROTECT__(*refToList);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4966
	    typeFaceList = *refToList;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4967
	    __SSEND1( typeFaceList, @symbol(add:), 0, t );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4968
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  4969
	return 1;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4970
}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  4971
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  4972
/*
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4973
 * take a LOGFONT structure and extract relevant data into a smalltalk array.
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4974
 *
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4975
 * Returned value is:
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4976
 *      #(
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4977
 *          1   lfHeight
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4978
 *          2   lfWidth
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4979
 *          3   lfEscapement
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4980
 *          4   lfOrientation
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4981
 *          5   lfWeight (Integer)
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4982
 *          6   lfWeight (String)
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4983
 *          7   lfItalic
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4984
 *          8   lfUnderline
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4985
 *          9   lfStrikeOut
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4986
 *         10   lfCharSet (Integer)
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4987
 *         11   lfOutPrecision
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4988
 *         12   lfClipPrecision
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4989
 *         13   lfQuality
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4990
 *         14   lfPitchAndFamily
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4991
 *         15   face and style name (String i.e. "bold-roman")
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4992
 *         16   face name from windows
4014
Claus Gittinger <cg@exept.de>
parents: 4013
diff changeset
  4993
 *         17   character encoding lfCharSet (as String i.e. "ms_ansi", "ms_oem", "ms_cyrillic")
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4994
 *         18
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4995
 *         19
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4996
 *         20
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4997
 *       )
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  4998
 * 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
  4999
 */
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  5000
OBJ
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  5001
__charSetSymbolFor(int charSet)
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5002
{
5576
1887b5235bf5 Use @symbol() instead of __MKSYMBOL() for constant symbols
Stefan Vogel <sv@exept.de>
parents: 5575
diff changeset
  5003
    OBJ s;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5004
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5005
    switch (charSet) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5006
	case ANSI_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5007
	    s = @symbol('ms-ansi');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5008
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5009
	case DEFAULT_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5010
	    s = @symbol('ms-default');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5011
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5012
	case SYMBOL_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5013
	    s = @symbol('ms-symbol');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5014
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5015
	case SHIFTJIS_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5016
	    s = @symbol('ms-shiftjis');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5017
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5018
	case GB2312_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5019
	    s = @symbol('ms-gb2312');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5020
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5021
	case HANGEUL_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5022
	    s = @symbol('ms-hangeul');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5023
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5024
# if defined(HANGUL_CHARSET) && (HANGUL_CHARSET != HANGEUL_CHARSET)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5025
	case HANGUL_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5026
	    s = @symbol('ms-hangul');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5027
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5028
# endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5029
	case CHINESEBIG5_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5030
	    s = @symbol('ms-chinesebig5');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5031
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5032
	case OEM_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5033
	    s = @symbol('ms-oem');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5034
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5035
# ifdef JOHAB_CHARSET
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5036
	case JOHAB_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5037
	    s = @symbol('ms-johab');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5038
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5039
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5040
# ifdef HEBREW_CHARSET
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5041
	case HEBREW_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5042
	    s = @symbol('ms-hebrew');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5043
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5044
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5045
# ifdef ARABIC_CHARSET
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5046
	case ARABIC_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5047
	    s = @symbol('ms-arabic');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5048
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5049
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5050
# ifdef GREEK_CHARSET
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5051
	case GREEK_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5052
	    s = @symbol('ms-greek');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5053
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5054
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5055
# ifdef TURKISH_CHARSET
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5056
	case TURKISH_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5057
	    s = @symbol('ms-turkish');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5058
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5059
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5060
# ifdef RUSSIAN_CHARSET
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5061
	case RUSSIAN_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5062
	    s = @symbol('ms-russian');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5063
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5064
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5065
# ifdef EASTEUROPE_CHARSET
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5066
	case EASTEUROPE_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5067
	    s = @symbol('ms-easteurope');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5068
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5069
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5070
# ifdef BALTIC_CHARSET
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5071
	case BALTIC_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5072
	    s = @symbol('ms-baltic');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5073
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5074
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5075
# ifdef VIETNAMESE_CHARSET
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5076
	case VIETNAMESE_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5077
	    s = @symbol('ms-vietnamese');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5078
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5079
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5080
# ifdef THAI_CHARSET
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5081
	case THAI_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5082
	    s = @symbol('ms-thai');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5083
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5084
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5085
# ifdef MAC_CHARSET
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5086
	case MAC_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5087
	    s = @symbol('ms-mac');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5088
	    break;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5089
# endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5090
# ifdef UNICODE_CHARSET
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5091
	case UNICODE_CHARSET:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5092
	    s = @symbol('ms-unicode');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5093
	    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5094
# endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5095
	default:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5096
	    s = @symbol(unknown);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5097
	    break;
5576
1887b5235bf5 Use @symbol() instead of __MKSYMBOL() for constant symbols
Stefan Vogel <sv@exept.de>
parents: 5575
diff changeset
  5098
    }
1887b5235bf5 Use @symbol() instead of __MKSYMBOL() for constant symbols
Stefan Vogel <sv@exept.de>
parents: 5575
diff changeset
  5099
    return s;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5100
}
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  5101
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  5102
OBJ
5574
c5a18b1d05fa volatile in primitive code callback funtions
Stefan Vogel <sv@exept.de>
parents: 5570
diff changeset
  5103
__extractLogicalFontParameters(LOGFONT *lplf)
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  5104
{
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5105
	OBJ newArray, t;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5106
	OBJ s;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5107
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5108
	DPRINTF((" lfHeight          %d\n", lplf->lfHeight ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5109
	DPRINTF((" lfWidth           %d\n", lplf->lfWidth  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5110
	DPRINTF((" lfEscapement      %d\n", lplf->lfEscapement  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5111
	DPRINTF((" lfOrientation     %d\n", lplf->lfOrientation  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5112
	DPRINTF((" lfWeight          %d\n", lplf->lfWeight  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5113
	DPRINTF((" lfItalic          %d\n", lplf->lfItalic  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5114
	DPRINTF((" lfUnderline       %d\n", lplf->lfUnderline  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5115
	DPRINTF((" lfStrikeOut       %d\n", lplf->lfStrikeOut  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5116
	DPRINTF((" lfCharSet         %d\n", lplf->lfCharSet  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5117
	DPRINTF((" lfOutPrecision    %d\n", lplf->lfOutPrecision  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5118
	DPRINTF((" lfClipPrecision   %d\n", lplf->lfClipPrecision  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5119
	DPRINTF((" lfQuality         %d\n", lplf->lfQuality  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5120
	DPRINTF((" lfPitchAndFamily  %d\n", lplf->lfPitchAndFamily  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5121
	DPRINTF((" lfFaceName        %s\n\n", lplf->lfFaceName  ));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5122
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5123
	newArray = __ARRAY_NEW_INT(20);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5124
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5125
	__ArrayInstPtr(newArray)->a_element[0] = __MKSMALLINT(lplf->lfHeight);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5126
	__ArrayInstPtr(newArray)->a_element[1] = __MKSMALLINT(lplf->lfWidth);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5127
	__ArrayInstPtr(newArray)->a_element[2] = __MKSMALLINT(lplf->lfEscapement);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5128
	__ArrayInstPtr(newArray)->a_element[3] = __MKSMALLINT(lplf->lfOrientation);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5129
	__ArrayInstPtr(newArray)->a_element[4] = __MKSMALLINT(lplf->lfWeight);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5130
	switch (lplf->lfWeight) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5131
	    case FW_HEAVY:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5132
	    case FW_EXTRABOLD:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5133
	    case FW_SEMIBOLD:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5134
	    case FW_BOLD:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5135
		s = @symbol(bold);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5136
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5137
	    case FW_NORMAL:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5138
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5139
		s = @symbol(normal);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5140
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5141
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5142
	    case FW_MEDIUM:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5143
		s = @symbol(medium);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5144
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5145
	    case FW_THIN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5146
	    case FW_EXTRALIGHT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5147
	    case FW_LIGHT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5148
		s = @symbol(demi);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5149
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5150
	    default:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5151
		s = @symbol(other);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5152
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5153
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5154
	__ArrayInstPtr(newArray)->a_element[5] = s; __STORE(newArray, s);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5155
	__ArrayInstPtr(newArray)->a_element[6] = __MKSMALLINT(lplf->lfItalic);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5156
	__ArrayInstPtr(newArray)->a_element[7] = __MKSMALLINT(lplf->lfUnderline);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5157
	__ArrayInstPtr(newArray)->a_element[8] = __MKSMALLINT(lplf->lfStrikeOut);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5158
	__ArrayInstPtr(newArray)->a_element[9] = __MKSMALLINT(lplf->lfCharSet);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5159
	__ArrayInstPtr(newArray)->a_element[10] = __MKSMALLINT(lplf->lfOutPrecision);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5160
	__ArrayInstPtr(newArray)->a_element[11] = __MKSMALLINT(lplf->lfClipPrecision);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5161
	__ArrayInstPtr(newArray)->a_element[12] = __MKSMALLINT(lplf->lfQuality);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5162
	__ArrayInstPtr(newArray)->a_element[13] = __MKSMALLINT(lplf->lfPitchAndFamily);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5163
	/* ... */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5164
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5165
	if( lplf->lfItalic == TRUE ) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5166
	    if( lplf->lfUnderline == TRUE ) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5167
		if( lplf->lfStrikeOut == TRUE ) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5168
		    s = @symbol('italic-underline-strikeOut');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5169
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5170
		    s = @symbol('italic-underline');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5171
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5172
	    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5173
		if( lplf->lfStrikeOut == TRUE ) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5174
		    s = @symbol('italic-strikeOut');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5175
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5176
		    s = @symbol('italic');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5177
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5178
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5179
	} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5180
	    if( lplf->lfUnderline == TRUE ) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5181
		if( lplf->lfStrikeOut == TRUE ) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5182
		    s = @symbol('roman-underline-strikeOut');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5183
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5184
		    s = @symbol('roman-underline');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5185
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5186
	    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5187
		if( lplf->lfStrikeOut == TRUE ) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5188
		    s = @symbol('roman-strikeOut');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5189
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5190
		    s = @symbol('roman');
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5191
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5192
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5193
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5194
	__ArrayInstPtr(newArray)->a_element[14] = s; __STORE(newArray, s);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5195
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5196
	__PROTECT__(newArray);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5197
	t = __MKSTRING(lplf->lfFaceName);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5198
	__UNPROTECT__(newArray);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5199
	__ArrayInstPtr(newArray)->a_element[15] = t; __STORE(newArray, t);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5200
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5201
	t = __charSetSymbolFor(lplf->lfCharSet);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5202
	__ArrayInstPtr(newArray)->a_element[16] = t; __STORE(newArray, t);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5203
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5204
	return newArray;
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  5205
}
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  5206
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5207
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  5208
static int CALLBACK
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5209
EnumFontsProc(
7614
3c353f6799d5 fix prev change
Stefan Vogel <sv@exept.de>
parents: 7613
diff changeset
  5210
    const LOGFONTTYPE *lplf,   // ptr to of logical-font data
3c353f6799d5 fix prev change
Stefan Vogel <sv@exept.de>
parents: 7613
diff changeset
  5211
    const TEXTMETRIC *lptm,    // ptr to physical font data
3c353f6799d5 fix prev change
Stefan Vogel <sv@exept.de>
parents: 7613
diff changeset
  5212
    DWORD dwType,              // font type
3c353f6799d5 fix prev change
Stefan Vogel <sv@exept.de>
parents: 7613
diff changeset
  5213
    LPARAM lpData              // application supplied data
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5214
) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5215
	volatile OBJ *refToList;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5216
	OBJ list;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5217
	OBJ infoArray;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5218
	OBJ *fullName;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5219
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5220
	DPRINTF(("EnumFontsProc\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5221
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5222
	if ( lplf ) {
7614
3c353f6799d5 fix prev change
Stefan Vogel <sv@exept.de>
parents: 7613
diff changeset
  5223
	    refToList = (OBJ *) lpData;
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5224
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5225
	    __PROTECT__(*refToList);
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
  5226
#ifdef USE_EnumFontFamiliesEx
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5227
	    infoArray = __extractLogicalFontParameters(lplf->elfLogFont);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5228
	    __PROTECT__(infoArray);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5229
	    fullName = __MKSTRING(lplf->elfFullName);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5230
	    __UNPROTECT__(infoArray);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5231
	    __ArrayInstPtr(infoArray)->a_element[17] = fullName; __STORE(infoArray, fullName);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5232
#else
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5233
	    infoArray = __extractLogicalFontParameters(lplf);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5234
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5235
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5236
	    __UNPROTECT__(*refToList);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5237
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5238
	    if ( dwType & TRUETYPE_FONTTYPE ) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5239
		/* change height to 0 to mark variable fonts */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5240
		__ArrayInstPtr(infoArray)->a_element[0] = __MKSMALLINT(0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5241
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5242
	    list = *refToList;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5243
	    __SSEND1(list, @symbol(add:), 0, infoArray);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5244
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  5245
	return 1;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5246
}
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  5247
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5248
struct EnumDisplayMonitorsProcData {
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5249
    OBJ hArray;
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5250
    int index;
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5251
};
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5252
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5253
static int CALLBACK
7613
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
  5254
EnumDisplayMonitorsProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM lpData)
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5255
{
7613
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
  5256
    struct EnumDisplayMonitorsProcData *procData = (struct EnumDisplayMonitorsProcData *)lpData;
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5257
    OBJ mHandle;
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5258
7613
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
  5259
    __PROTECT__(procData->hArray);
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5260
    mHandle = __MKEXTERNALADDRESS(hMonitor);
7613
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
  5261
    __UNPROTECT__(procData->hArray);
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
  5262
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
  5263
    __arrayVal(procData->hArray)[procData->index++] = mHandle;
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
  5264
    __STORE(procData->hArray, mHandle);
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5265
    return (1);
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5266
}
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  5267
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5268
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5269
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5270
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5271
!WinWorkstation class methodsFor:'documentation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5272
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5273
copyright
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5274
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5275
COPYRIGHT (c) 1996 by Claus Gittinger
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5276
	      All Rights Reserved
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5277
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5278
 This software is furnished under a license and may be used
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5279
 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
  5280
 inclusion of the above copyright notice.   This software may not
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5281
 be provided or otherwise made available to, or used by, any
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5282
 other person.  No title to or ownership of the software is
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5283
 hereby transferred.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5284
"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5285
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5286
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5287
documentation
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5288
"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5289
    See more documentation in my superclass, DeviceWorkstation.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5290
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5291
    [author:]
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  5292
	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
  5293
	Manfred Dierolf (many, many changes & fixes, multithreading etc.)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5294
"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5295
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5296
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5297
!WinWorkstation class methodsFor:'initialization'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5298
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  5299
initialize
5940
c7f52860ba82 changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 5910
diff changeset
  5300
    "/ super initialize.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5301
    self initializeStandardColorNames.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5302
5598
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
  5303
    NativeWidgets := NativeDialogs := NativeFileDialogs := false.
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  5304
    BeepDuration := 200.        "milliseconds"
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5305
    ButtonTranslation := #(1 2 2).
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  5306
3574
db1360ba8dea *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3573
diff changeset
  5307
    "/ SysColorChanges are reported *very* often when exceed is running,
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  5308
    "/ but are also needed to update my view colors when the settings change.
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5309
    "/ I don't know what exceed is doing there ...
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  5310
    "/ IgnoreSysColorChanges := true.
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  5311
    IgnoreSysColorChanges := false.
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  5312
    SystemColorValues := IdentityDictionary new.
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  5313
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5314
    "/ translation table from ST/X windowType symbol (system-independent)
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  5315
    "/ to Windows windowClass (windows-specific).
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5316
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5317
    NativeWidgetClassTable := IdentityDictionary
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5318
	withKeysAndValues:#(
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5319
		ScrollBar                 SCROLLBAR
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5320
		HorizontalScrollBar       SCROLLBAR
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5321
		VerticalScrollBar         SCROLLBAR
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5322
		CheckBox                  BUTTON
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5323
		RadioButton               BUTTON
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5324
		Button                    BUTTON
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5325
		DefaultButton             BUTTON
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5326
		OwnerDrawButton           BUTTON
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5327
		ComboBox                  COMBOBOX
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5328
		EditField                 EDIT
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5329
		ListBox                   LISTBOX
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5330
	).
5598
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
  5331
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
  5332
    "Modified: / 24-08-2010 / 16:42:23 / sr"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5333
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  5334
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5335
initializeStandardColorNames
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5336
    "{ Pragma: +optSpace }"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5337
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  5338
    "setup standard color names (X-color names)"
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  5339
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5340
    StandardColorValues := Dictionary
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5341
	withKeysAndValues:#(
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5342
	    'aliceblue'     (240 248 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5343
	    'antiquewhite'  (250 235 215)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5344
	    'AntiqueWhite1' (255 239 219)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5345
	    'AntiqueWhite2' (238 223 204)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5346
	    'AntiqueWhite3' (205 192 176)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5347
	    'AntiqueWhite4' (139 131 120)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5348
	    'aquamarine'    (127 255 212)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5349
	    'aquamarine1'   (127 255 212)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5350
	    'aquamarine2'   (118 238 198)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5351
	    'aquamarine3'   (102 205 170)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5352
	    'aquamarine4'   (69 139 116)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5353
	    'azure'         (240 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5354
	    'azure1'        (240 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5355
	    'azure2'        (224 238 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5356
	    'azure3'        (193 205 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5357
	    'azure4'        (131 139 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5358
	    'beige'         (245 245 220)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5359
	    'bisque'        (255 228 196)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5360
	    'bisque1'       (255 228 196)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5361
	    'bisque2'       (238 213 183)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5362
	    'bisque3'       (205 183 158)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5363
	    'bisque4'       (139 125 107)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5364
	    'black'         (0 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5365
	    'blanchedalmond'        (255 235 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5366
	    'blue'          (0 0 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5367
	    'blueviolet'    (138 43 226)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5368
	    'blue1'         (0 0 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5369
	    'blue2'         (0 0 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5370
	    'blue3'         (0 0 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5371
	    'blue4'         (0 0 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5372
	    'brown'         (165 42 42)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5373
	    'brown1'        (255 64 64)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5374
	    'brown2'        (238 59 59)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5375
	    'brown3'        (205 51 51)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5376
	    'brown4'        (139 35 35)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5377
	    'burlywood'     (222 184 135)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5378
	    'burlywood1'    (255 211 155)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5379
	    'burlywood2'    (238 197 145)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5380
	    'burlywood3'    (205 170 125)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5381
	    'burlywood4'    (139 115 85)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5382
	    'cadetblue'     (95 158 160)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5383
	    'CadetBlue1'    (152 245 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5384
	    'CadetBlue2'    (142 229 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5385
	    'CadetBlue3'    (122 197 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5386
	    'CadetBlue4'    (83 134 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5387
	    'chartreuse'    (127 255 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5388
	    'chartreuse1'   (127 255 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5389
	    'chartreuse2'   (118 238 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5390
	    'chartreuse3'   (102 205 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5391
	    'chartreuse4'   (69 139 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5392
	    'chocolate'     (210 105 30)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5393
	    'chocolate1'    (255 127 36)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5394
	    'chocolate2'    (238 118 33)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5395
	    'chocolate3'    (205 102 29)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5396
	    'chocolate4'    (139 69 19)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5397
	    'coral'         (255 127 80)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5398
	    'coral1'        (255 114 86)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5399
	    'coral2'        (238 106 80)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5400
	    'coral3'        (205 91 69)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5401
	    'coral4'        (139 62 47)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5402
	    'cornflowerblue'        (100 149 237)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5403
	    'cornsilk'      (255 248 220)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5404
	    'cornsilk1'     (255 248 220)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5405
	    'cornsilk2'     (238 232 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5406
	    'cornsilk3'     (205 200 177)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5407
	    'cornsilk4'     (139 136 120)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5408
	    'cyan'          (0 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5409
	    'cyan1'         (0 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5410
	    'cyan2'         (0 238 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5411
	    'cyan3'         (0 205 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5412
	    'cyan4'         (0 139 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5413
	    'darkblue'      (0 0 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5414
	    'darkcyan'      (0 139 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5415
	    'darkgoldenrod' (184 134 11)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5416
	    'darkgray'      (169 169 169)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5417
	    'darkgreen'     (0 100 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5418
	    'darkgrey'      (169 169 169)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5419
	    'darkkhaki'     (189 183 107)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5420
	    'darkmagenta'   (139 0 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5421
	    'darkolivegreen'        (85 107 47)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5422
	    'darkorange'    (255 140 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5423
	    'darkorchid'    (153 50 204)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5424
	    'darkred'       (139 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5425
	    'darksalmon'    (233 150 122)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5426
	    'darkseagreen'  (143 188 143)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5427
	    'darkslateblue' (72 61 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5428
	    'darkslategray' (47 79 79)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5429
	    'darkslategrey' (47 79 79)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5430
	    'darkturquoise' (0 206 209)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5431
	    'darkviolet'    (148 0 211)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5432
	    'DarkGoldenrod1'        (255 185 15)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5433
	    'DarkGoldenrod2'        (238 173 14)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5434
	    'DarkGoldenrod3'        (205 149 12)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5435
	    'DarkGoldenrod4'        (139 101 8)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5436
	    'DarkOliveGreen1'       (202 255 112)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5437
	    'DarkOliveGreen2'       (188 238 104)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5438
	    'DarkOliveGreen3'       (162 205 90)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5439
	    'DarkOliveGreen4'       (110 139 61)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5440
	    'DarkOrange1'   (255 127 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5441
	    'DarkOrange2'   (238 118 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5442
	    'DarkOrange3'   (205 102 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5443
	    'DarkOrange4'   (139 69 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5444
	    'DarkOrchid1'   (191 62 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5445
	    'DarkOrchid2'   (178 58 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5446
	    'DarkOrchid3'   (154 50 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5447
	    'DarkOrchid4'   (104 34 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5448
	    'DarkSeaGreen1' (193 255 193)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5449
	    'DarkSeaGreen2' (180 238 180)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5450
	    'DarkSeaGreen3' (155 205 155)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5451
	    'DarkSeaGreen4' (105 139 105)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5452
	    'DarkSlateGray1'        (151 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5453
	    'DarkSlateGray2'        (141 238 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5454
	    'DarkSlateGray3'        (121 205 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5455
	    'DarkSlateGray4'        (82 139 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5456
	    'deeppink'      (255 20 147)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5457
	    'deepskyblue'   (0 191 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5458
	    'DeepPink'      (255 20 147)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5459
	    'DeepPink1'     (255 20 147)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5460
	    'DeepPink2'     (238 18 137)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5461
	    'DeepPink3'     (205 16 118)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5462
	    'DeepPink4'     (139 10 80)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5463
	    'DeepSkyBlue1'  (0 191 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5464
	    'DeepSkyBlue2'  (0 178 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5465
	    'DeepSkyBlue3'  (0 154 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5466
	    'DeepSkyBlue4'  (0 104 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5467
	    'dimgray'       (105 105 105)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5468
	    'dimgrey'       (105 105 105)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5469
	    'dodgerblue'    (30 144 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5470
	    'DodgerBlue1'   (30 144 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5471
	    'DodgerBlue2'   (28 134 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5472
	    'DodgerBlue3'   (24 116 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5473
	    'DodgerBlue4'   (16 78 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5474
	    'firebrick'     (178 34 34)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5475
	    'firebrick1'    (255 48 48)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5476
	    'firebrick2'    (238 44 44)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5477
	    'firebrick3'    (205 38 38)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5478
	    'firebrick4'    (139 26 26)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5479
	    'floralwhite'   (255 250 240)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5480
	    'forestgreen'   (34 139 34)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5481
	    'gainsboro'     (220 220 220)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5482
	    'ghostwhite'    (248 248 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5483
	    'gold'          (255 215 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5484
	    'gold1'         (255 215 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5485
	    'gold2'         (238 201 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5486
	    'gold3'         (205 173 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5487
	    'gold4'         (139 117 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5488
	    'goldenrod'     (218 165 32)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5489
	    'goldenrod1'    (255 193 37)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5490
	    'goldenrod2'    (238 180 34)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5491
	    'goldenrod3'    (205 155 29)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5492
	    'goldenrod4'    (139 105 20)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5493
	    'grey'          (192 192 192)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5494
	    'grey0'         (0 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5495
	    'grey1'         (3 3 3)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5496
	    'grey10'        (26 26 26)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5497
	    'grey100'       (255 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5498
	    'grey11'        (28 28 28)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5499
	    'grey12'        (31 31 31)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5500
	    'grey13'        (33 33 33)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5501
	    'grey14'        (36 36 36)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5502
	    'grey15'        (38 38 38)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5503
	    'grey16'        (41 41 41)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5504
	    'grey17'        (43 43 43)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5505
	    'grey18'        (46 46 46)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5506
	    'grey19'        (48 48 48)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5507
	    'grey2'         (5 5 5)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5508
	    'grey20'        (51 51 51)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5509
	    'grey21'        (54 54 54)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5510
	    'grey22'        (56 56 56)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5511
	    'grey23'        (59 59 59)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5512
	    'grey24'        (61 61 61)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5513
	    'grey25'        (64 64 64)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5514
	    'grey26'        (66 66 66)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5515
	    'grey27'        (69 69 69)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5516
	    'grey28'        (71 71 71)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5517
	    'grey29'        (74 74 74)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5518
	    'grey3'         (8 8 8)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5519
	    'grey30'        (77 77 77)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5520
	    'grey31'        (79 79 79)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5521
	    'grey32'        (82 82 82)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5522
	    'grey33'        (84 84 84)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5523
	    'grey34'        (87 87 87)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5524
	    'grey35'        (89 89 89)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5525
	    'grey36'        (92 92 92)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5526
	    'grey37'        (94 94 94)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5527
	    'grey38'        (97 97 97)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5528
	    'grey39'        (99 99 99)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5529
	    'grey4'         (10 10 10)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5530
	    'grey40'        (102 102 102)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5531
	    'grey41'        (105 105 105)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5532
	    'grey42'        (107 107 107)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5533
	    'grey43'        (110 110 110)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5534
	    'grey44'        (112 112 112)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5535
	    'grey45'        (115 115 115)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5536
	    'grey46'        (117 117 117)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5537
	    'grey47'        (120 120 120)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5538
	    'grey48'        (122 122 122)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5539
	    'grey49'        (125 125 125)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5540
	    'grey5'         (13 13 13)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5541
	    'grey50'        (127 127 127)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5542
	    'grey51'        (130 130 130)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5543
	    'grey52'        (133 133 133)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5544
	    'grey53'        (135 135 135)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5545
	    'grey54'        (138 138 138)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5546
	    'grey55'        (140 140 140)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5547
	    'grey56'        (143 143 143)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5548
	    'grey57'        (145 145 145)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5549
	    'grey58'        (148 148 148)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5550
	    'grey59'        (150 150 150)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5551
	    'grey6'         (15 15 15)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5552
	    'grey60'        (153 153 153)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5553
	    'grey61'        (156 156 156)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5554
	    'grey62'        (158 158 158)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5555
	    'grey63'        (161 161 161)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5556
	    'grey64'        (163 163 163)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5557
	    'grey65'        (166 166 166)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5558
	    'grey66'        (168 168 168)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5559
	    'grey67'        (171 171 171)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5560
	    'grey68'        (173 173 173)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5561
	    'grey69'        (176 176 176)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5562
	    'grey7'         (18 18 18)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5563
	    'grey70'        (179 179 179)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5564
	    'grey71'        (181 181 181)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5565
	    'grey72'        (184 184 184)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5566
	    'grey73'        (186 186 186)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5567
	    'grey74'        (189 189 189)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5568
	    'grey75'        (191 191 191)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5569
	    'grey76'        (194 194 194)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5570
	    'grey77'        (196 196 196)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5571
	    'grey78'        (199 199 199)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5572
	    'grey79'        (201 201 201)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5573
	    'grey8'         (20 20 20)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5574
	    'grey80'        (204 204 204)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5575
	    'grey81'        (207 207 207)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5576
	    'grey82'        (209 209 209)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5577
	    'grey83'        (212 212 212)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5578
	    'grey84'        (214 214 214)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5579
	    'grey85'        (217 217 217)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5580
	    'grey86'        (219 219 219)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5581
	    'grey87'        (222 222 222)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5582
	    'grey88'        (224 224 224)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5583
	    'grey89'        (227 227 227)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5584
	    'grey9'         (23 23 23)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5585
	    'grey90'        (229 229 229)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5586
	    'grey91'        (232 232 232)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5587
	    'grey92'        (235 235 235)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5588
	    'grey93'        (237 237 237)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5589
	    'grey94'        (240 240 240)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5590
	    'grey95'        (242 242 242)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5591
	    'grey96'        (245 245 245)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5592
	    'grey97'        (247 247 247)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5593
	    'grey98'        (250 250 250)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5594
	    'grey99'        (252 252 252)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5595
	    'gray'          (192 192 192)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5596
	    'gray0'         (0 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5597
	    'gray1'         (3 3 3)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5598
	    'gray10'        (26 26 26)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5599
	    'gray100'       (255 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5600
	    'gray11'        (28 28 28)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5601
	    'gray12'        (31 31 31)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5602
	    'gray13'        (33 33 33)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5603
	    'gray14'        (36 36 36)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5604
	    'gray15'        (38 38 38)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5605
	    'gray16'        (41 41 41)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5606
	    'gray17'        (43 43 43)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5607
	    'gray18'        (46 46 46)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5608
	    'gray19'        (48 48 48)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5609
	    'gray2'         (5 5 5)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5610
	    'gray20'        (51 51 51)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5611
	    'gray21'        (54 54 54)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5612
	    'gray22'        (56 56 56)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5613
	    'gray23'        (59 59 59)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5614
	    'gray24'        (61 61 61)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5615
	    'gray25'        (64 64 64)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5616
	    'gray26'        (66 66 66)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5617
	    'gray27'        (69 69 69)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5618
	    'gray28'        (71 71 71)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5619
	    'gray29'        (74 74 74)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5620
	    'gray3'         (8 8 8)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5621
	    'gray30'        (77 77 77)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5622
	    'gray31'        (79 79 79)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5623
	    'gray32'        (82 82 82)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5624
	    'gray33'        (84 84 84)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5625
	    'gray34'        (87 87 87)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5626
	    'gray35'        (89 89 89)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5627
	    'gray36'        (92 92 92)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5628
	    'gray37'        (94 94 94)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5629
	    'gray38'        (97 97 97)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5630
	    'gray39'        (99 99 99)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5631
	    'gray4'         (10 10 10)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5632
	    'gray40'        (102 102 102)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5633
	    'gray41'        (105 105 105)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5634
	    'gray42'        (107 107 107)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5635
	    'gray43'        (110 110 110)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5636
	    'gray44'        (112 112 112)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5637
	    'gray45'        (115 115 115)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5638
	    'gray46'        (117 117 117)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5639
	    'gray47'        (120 120 120)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5640
	    'gray48'        (122 122 122)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5641
	    'gray49'        (125 125 125)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5642
	    'gray5'         (13 13 13)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5643
	    'gray50'        (127 127 127)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5644
	    'gray51'        (130 130 130)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5645
	    'gray52'        (133 133 133)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5646
	    'gray53'        (135 135 135)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5647
	    'gray54'        (138 138 138)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5648
	    'gray55'        (140 140 140)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5649
	    'gray56'        (143 143 143)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5650
	    'gray57'        (145 145 145)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5651
	    'gray58'        (148 148 148)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5652
	    'gray59'        (150 150 150)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5653
	    'gray6'         (15 15 15)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5654
	    'gray60'        (153 153 153)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5655
	    'gray61'        (156 156 156)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5656
	    'gray62'        (158 158 158)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5657
	    'gray63'        (161 161 161)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5658
	    'gray64'        (163 163 163)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5659
	    'gray65'        (166 166 166)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5660
	    'gray66'        (168 168 168)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5661
	    'gray67'        (171 171 171)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5662
	    'gray68'        (173 173 173)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5663
	    'gray69'        (176 176 176)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5664
	    'gray7'         (18 18 18)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5665
	    'gray70'        (179 179 179)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5666
	    'gray71'        (181 181 181)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5667
	    'gray72'        (184 184 184)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5668
	    'gray73'        (186 186 186)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5669
	    'gray74'        (189 189 189)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5670
	    'gray75'        (191 191 191)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5671
	    'gray76'        (194 194 194)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5672
	    'gray77'        (196 196 196)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5673
	    'gray78'        (199 199 199)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5674
	    'gray79'        (201 201 201)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5675
	    'gray8'         (20 20 20)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5676
	    'gray80'        (204 204 204)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5677
	    'gray81'        (207 207 207)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5678
	    'gray82'        (209 209 209)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5679
	    'gray83'        (212 212 212)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5680
	    'gray84'        (214 214 214)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5681
	    'gray85'        (217 217 217)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5682
	    'gray86'        (219 219 219)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5683
	    'gray87'        (222 222 222)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5684
	    'gray88'        (224 224 224)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5685
	    'gray89'        (227 227 227)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5686
	    'gray9'         (23 23 23)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5687
	    'gray90'        (229 229 229)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5688
	    'gray91'        (232 232 232)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5689
	    'gray92'        (235 235 235)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5690
	    'gray93'        (237 237 237)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5691
	    'gray94'        (240 240 240)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5692
	    'gray95'        (242 242 242)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5693
	    'gray96'        (245 245 245)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5694
	    'gray97'        (247 247 247)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5695
	    'gray98'        (250 250 250)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5696
	    'gray99'        (252 252 252)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5697
	    'green'         (0 255 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5698
	    'greenyellow'   (173 255 47)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5699
	    'green1'        (0 255 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5700
	    'green2'        (0 238 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5701
	    'green3'        (0 205 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5702
	    'green4'        (0 139 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5703
	    'honeydew'      (240 255 240)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5704
	    'honeydew1'     (240 255 240)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5705
	    'honeydew2'     (224 238 224)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5706
	    'honeydew3'     (193 205 193)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5707
	    'honeydew4'     (131 139 131)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5708
	    'hotpink'       (255 105 180)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5709
	    'HotPink1'      (255 110 180)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5710
	    'HotPink2'      (238 106 167)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5711
	    'HotPink3'      (205 96 144)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5712
	    'HotPink4'      (139 58 98)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5713
	    'indianred'     (205 92 92)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5714
	    'IndianRed1'    (255 106 106)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5715
	    'IndianRed2'    (238 99 99)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5716
	    'IndianRed3'    (205 85 85)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5717
	    'IndianRed4'    (139 58 58)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5718
	    'ivory'         (255 255 240)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5719
	    'ivory1'        (255 255 240)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5720
	    'ivory2'        (238 238 224)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5721
	    'ivory3'        (205 205 193)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5722
	    'ivory4'        (139 139 131)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5723
	    'khaki'         (240 230 140)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5724
	    'khaki1'        (255 246 143)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5725
	    'khaki2'        (238 230 133)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5726
	    'khaki3'        (205 198 115)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5727
	    'khaki4'        (139 134 78)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5728
	    'lavender'      (230 230 250)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5729
	    'lavenderblush'         (255 240 245)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5730
	    'LavenderBlush1'        (255 240 245)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5731
	    'LavenderBlush2'        (238 224 229)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5732
	    'LavenderBlush3'        (205 193 197)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5733
	    'LavenderBlush4'        (139 131 134)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5734
	    'lawngreen'     (124 252 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5735
	    'lemonchiffon'  (255 250 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5736
	    'LemonChiffon1'         (255 250 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5737
	    'LemonChiffon2'         (238 233 191)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5738
	    'LemonChiffon3'         (205 201 165)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5739
	    'LemonChiffon4'         (139 137 112)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5740
	    'lightblue'     (173 216 230)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5741
	    'lightcoral'    (240 128 128)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5742
	    'lightcyan'     (224 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5743
	    'lightgoldenrod'        (238 221 130)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5744
	    'lightgoldenrodyellow'  (250 250 210)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5745
	    'lightgray'     (211 211 211)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5746
	    'lightgreen'    (144 238 144)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5747
	    'lightgrey'     (211 211 211)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5748
	    'lightpink'     (255 182 193)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5749
	    'lightsalmon'   (255 160 122)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5750
	    'lightseagreen' (32 178 170)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5751
	    'lightskyblue'  (135 206 250)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5752
	    'lightslateblue'        (132 112 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5753
	    'lightslategray'        (119 136 153)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5754
	    'lightslategrey'        (119 136 153)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5755
	    'lightsteelblue'        (176 196 222)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5756
	    'lightyellow'   (255 255 224)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5757
	    'LightBlue1'    (191 239 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5758
	    'LightBlue2'    (178 223 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5759
	    'LightBlue3'    (154 192 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5760
	    'LightBlue4'    (104 131 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5761
	    'LightCyan1'    (224 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5762
	    'LightCyan2'    (209 238 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5763
	    'LightCyan3'    (180 205 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5764
	    'LightCyan4'    (122 139 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5765
	    'LightGoldenrod1'       (255 236 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5766
	    'LightGoldenrod2'       (238 220 130)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5767
	    'LightGoldenrod3'       (205 190 112)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5768
	    'LightGoldenrod4'       (139 129 76)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5769
	    'LightPink1'    (255 174 185)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5770
	    'LightPink2'    (238 162 173)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5771
	    'LightPink3'    (205 140 149)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5772
	    'LightPink4'    (139 95 101)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5773
	    'LightSalmon1'  (255 160 122)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5774
	    'LightSalmon2'  (238 149 114)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5775
	    'LightSalmon3'  (205 129 98)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5776
	    'LightSalmon4'  (139 87 66)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5777
	    'LightSkyBlue1'         (176 226 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5778
	    'LightSkyBlue2'         (164 211 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5779
	    'LightSkyBlue3'         (141 182 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5780
	    'LightSkyBlue4'         (96 123 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5781
	    'LightSteelBlue1'       (202 225 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5782
	    'LightSteelBlue2'       (188 210 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5783
	    'LightSteelBlue3'       (162 181 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5784
	    'LightSteelBlue4'       (110 123 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5785
	    'LightYellow1'  (255 255 224)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5786
	    'LightYellow2'  (238 238 209)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5787
	    'LightYellow3'  (205 205 180)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5788
	    'LightYellow4'  (139 139 122)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5789
	    'limegreen'     (50 205 50)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5790
	    'linen'         (250 240 230)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5791
	    'magenta'       (255 0 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5792
	    'magenta1'      (255 0 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5793
	    'magenta2'      (238 0 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5794
	    'magenta3'      (205 0 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5795
	    'magenta4'      (139 0 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5796
	    'maroon'        (176 48 96)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5797
	    'maroon1'       (255 52 179)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5798
	    'maroon2'       (238 48 167)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5799
	    'maroon3'       (205 41 144)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5800
	    'maroon4'       (139 28 98)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5801
	    'mediumaquamarine'      (102 205 170)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5802
	    'mediumblue'    (0 0 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5803
	    'mediumorchid'  (186 85 211)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5804
	    'mediumpurple'  (147 112 219)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5805
	    'mediumseagreen'        (60 179 113)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5806
	    'mediumslateblue'       (123 104 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5807
	    'mediumspringgreen'     (0 250 154)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5808
	    'mediumturquoise'       (72 209 204)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5809
	    'mediumvioletred'       (199 21 133)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5810
	    'MediumOrchid1'         (224 102 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5811
	    'MediumOrchid2' (209 95 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5812
	    'MediumOrchid3' (180 82 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5813
	    'MediumOrchid4' (122 55 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5814
	    'MediumPurple1' (171 130 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5815
	    'MediumPurple2' (159 121 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5816
	    'MediumPurple3' (137 104 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5817
	    'MediumPurple4' (93 71 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5818
	    'midnightblue'  (25 25 112)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5819
	    'mintcream'     (245 255 250)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5820
	    'mistyrose'     (255 228 225)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5821
	    'MistyRose1'    (255 228 225)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5822
	    'MistyRose2'    (238 213 210)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5823
	    'MistyRose3'    (205 183 181)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5824
	    'MistyRose4'    (139 125 123)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5825
	    'moccasin'      (255 228 181)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5826
	    'navajowhite'   (255 222 173)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5827
	    'NavajoWhite1'  (255 222 173)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5828
	    'NavajoWhite2'  (238 207 161)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5829
	    'NavajoWhite3'  (205 179 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5830
	    'NavajoWhite4'  (139 121 94)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5831
	    'navy'          (0 0 128)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5832
	    'navyblue'      (0 0 128)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5833
	    'oldlace'       (253 245 230)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5834
	    'olivedrab'     (107 142 35)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5835
	    'OliveDrab1'    (192 255 62)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5836
	    'OliveDrab2'    (179 238 58)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5837
	    'OliveDrab3'    (154 205 50)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5838
	    'OliveDrab4'    (105 139 34)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5839
	    'orange'        (255 165 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5840
	    'orange1'       (255 165 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5841
	    'orange2'       (238 154 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5842
	    'orange3'       (205 133 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5843
	    'orange4'       (139 90 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5844
	    'orangered'     (255 69 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5845
	    'OrangeRed1'    (255 69 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5846
	    'OrangeRed2'    (238 64 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5847
	    'OrangeRed3'    (205 55 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5848
	    'OrangeRed4'    (139 37 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5849
	    'orchid'        (218 112 214)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5850
	    'orchid1'       (255 131 250)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5851
	    'orchid2'       (238 122 233)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5852
	    'orchid3'       (205 105 201)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5853
	    'orchid4'       (139 71 137)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5854
	    'palegoldenrod' (238 232 170)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5855
	    'palegreen'     (152 251 152)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5856
	    'paleturquoise' (175 238 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5857
	    'palevioletred' (219 112 147)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5858
	    'PaleGreen1'    (154 255 154)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5859
	    'PaleGreen2'    (144 238 144)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5860
	    'PaleGreen3'    (124 205 124)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5861
	    'PaleGreen4'    (84 139 84)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5862
	    'PaleTurquoise1'        (187 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5863
	    'PaleTurquoise2'        (174 238 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5864
	    'PaleTurquoise3'        (150 205 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5865
	    'PaleTurquoise4'        (102 139 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5866
	    'PaleVioletRed1'        (255 130 171)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5867
	    'PaleVioletRed2'        (238 121 159)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5868
	    'PaleVioletRed3'        (205 104 137)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5869
	    'PaleVioletRed4'        (139 71 93)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5870
	    'papayawhip'    (255 239 213)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5871
	    'peachpuff'     (255 218 185)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5872
	    'PeachPuff1'    (255 218 185)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5873
	    'PeachPuff2'    (238 203 173)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5874
	    'PeachPuff3'    (205 175 149)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5875
	    'PeachPuff4'    (139 119 101)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5876
	    'peru'  (205 133 63)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5877
	    'pink'  (255 192 203)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5878
	    'pink1' (255 181 197)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5879
	    'pink2' (238 169 184)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5880
	    'pink3' (205 145 158)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5881
	    'pink4' (139 99 108)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5882
	    'plum'  (221 160 221)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5883
	    'plum1' (255 187 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5884
	    'plum2' (238 174 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5885
	    'plum3' (205 150 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5886
	    'plum4' (139 102 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5887
	    'powderblue'    (176 224 230)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5888
	    'purple'        (160 32 240)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5889
	    'purple1'       (155 48 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5890
	    'purple2'       (145 44 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5891
	    'purple3'       (125 38 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5892
	    'purple4'       (85 26 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5893
	    'red'   (255 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5894
	    'red1'  (255 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5895
	    'red2'  (238 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5896
	    'red3'  (205 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5897
	    'red4'  (139 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5898
	    'rosybrown'     (188 143 143)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5899
	    'RosyBrown1'    (255 193 193)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5900
	    'RosyBrown2'    (238 180 180)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5901
	    'RosyBrown3'    (205 155 155)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5902
	    'RosyBrown4'    (139 105 105)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5903
	    'royalblue'     (65 105 225)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5904
	    'RoyalBlue1'    (72 118 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5905
	    'RoyalBlue2'    (67 110 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5906
	    'RoyalBlue3'    (58 95 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5907
	    'RoyalBlue4'    (39 64 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5908
	    'saddlebrown'   (139 69 19)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5909
	    'salmon'        (250 128 114)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5910
	    'salmon1'       (255 140 105)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5911
	    'salmon2'       (238 130 98)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5912
	    'salmon3'       (205 112 84)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5913
	    'salmon4'       (139 76 57)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5914
	    'sandybrown'    (244 164 96)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5915
	    'scoActiveBackground'   (255 206 137)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5916
	    'scoActiveForeground'   (43 45 49)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5917
	    'scoActiveTopShadow'    (254 222 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5918
	    'scoAltBackground'      (172 186 204)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5919
	    'scoBackground' (203 203 192)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5920
	    'scoForeground' (11 0 113)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5921
	    'scoHighlight'  (141 178 215)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5922
	    'scoTopShadow'  (255 240 248)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5923
	    'seagreen'      (46 139 87)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5924
	    'SeaGreen1'     (84 255 159)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5925
	    'SeaGreen2'     (78 238 148)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5926
	    'SeaGreen3'     (67 205 128)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5927
	    'SeaGreen4'     (46 139 87)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5928
	    'seashell'      (255 245 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5929
	    'seashell1'     (255 245 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5930
	    'seashell2'     (238 229 222)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5931
	    'seashell3'     (205 197 191)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5932
	    'seashell4'     (139 134 130)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5933
	    'sgi beet'      (142 56 142)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5934
	    'sgi bright gray'       (197 193 170)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5935
	    'sgi bright grey'       (197 193 170)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5936
	    'sgi chartreuse'        (113 198 113)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5937
	    'sgi dark gray' (85 85 85)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5938
	    'sgi dark grey' (85 85 85)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5939
	    'sgi gray 0'    (0 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5940
	    'sgi gray 100'  (255 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5941
	    'sgi gray 12'   (30 30 30)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5942
	    'sgi gray 16'   (40 40 40)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5943
	    'sgi gray 20'   (51 51 51)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5944
	    'sgi gray 24'   (61 61 61)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5945
	    'sgi gray 28'   (71 71 71)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5946
	    'sgi gray 32'   (81 81 81)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5947
	    'sgi gray 36'   (91 91 91)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5948
	    'sgi gray 4'    (10 10 10)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5949
	    'sgi gray 40'   (102 102 102)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5950
	    'sgi gray 44'   (112 112 112)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5951
	    'sgi gray 48'   (122 122 122)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5952
	    'sgi gray 52'   (132 132 132)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5953
	    'sgi gray 56'   (142 142 142)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5954
	    'sgi gray 60'   (153 153 153)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5955
	    'sgi gray 64'   (163 163 163)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5956
	    'sgi gray 68'   (173 173 173)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5957
	    'sgi gray 72'   (183 183 183)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5958
	    'sgi gray 76'   (193 193 193)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5959
	    'sgi gray 8'    (20 20 20)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5960
	    'sgi gray 80'   (204 204 204)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5961
	    'sgi gray 84'   (214 214 214)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5962
	    'sgi gray 88'   (224 224 224)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5963
	    'sgi gray 92'   (234 234 234)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5964
	    'sgi gray 96'   (244 244 244)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5965
	    'sgi grey 0'    (0 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5966
	    'sgi grey 100'  (255 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5967
	    'sgi grey 12'   (30 30 30)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5968
	    'sgi grey 16'   (40 40 40)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5969
	    'sgi grey 20'   (51 51 51)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5970
	    'sgi grey 24'   (61 61 61)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5971
	    'sgi grey 28'   (71 71 71)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5972
	    'sgi grey 32'   (81 81 81)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5973
	    'sgi grey 36'   (91 91 91)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5974
	    'sgi grey 4'    (10 10 10)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5975
	    'sgi grey 40'   (102 102 102)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5976
	    'sgi grey 44'   (112 112 112)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5977
	    'sgi grey 48'   (122 122 122)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5978
	    'sgi grey 52'   (132 132 132)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5979
	    'sgi grey 56'   (142 142 142)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5980
	    'sgi grey 60'   (153 153 153)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5981
	    'sgi grey 64'   (163 163 163)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5982
	    'sgi grey 68'   (173 173 173)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5983
	    'sgi grey 72'   (183 183 183)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5984
	    'sgi grey 76'   (193 193 193)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5985
	    'sgi grey 8'    (20 20 20)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5986
	    'sgi grey 80'   (204 204 204)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5987
	    'sgi grey 84'   (214 214 214)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5988
	    'sgi grey 88'   (224 224 224)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5989
	    'sgi grey 92'   (234 234 234)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5990
	    'sgi grey 96'   (244 244 244)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5991
	    'sgi light blue'        (125 158 192)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5992
	    'sgi light gray'        (170 170 170)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5993
	    'sgi light grey'        (170 170 170)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5994
	    'sgi medium gray'       (132 132 132)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5995
	    'sgi medium grey'       (132 132 132)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5996
	    'sgi olive drab'        (142 142 56)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5997
	    'sgi salmon'    (198 113 113)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5998
	    'sgi slate blue'        (113 113 198)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  5999
	    'sgi teal'      (56 142 142)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6000
	    'sgi very dark gray'    (40 40 40)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6001
	    'sgi very dark grey'    (40 40 40)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6002
	    'sgi very light gray'   (214 214 214)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6003
	    'sgi very light grey'   (214 214 214)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6004
	    'SGIBeet'       (142 56 142)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6005
	    'SGIBrightGray' (197 193 170)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6006
	    'SGIBrightGrey' (197 193 170)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6007
	    'SGIChartreuse' (113 198 113)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6008
	    'SGIDarkGray'   (85 85 85)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6009
	    'SGIDarkGrey'   (85 85 85)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6010
	    'SGIGray0'      (0 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6011
	    'SGIGray100'    (255 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6012
	    'SGIGray12'     (30 30 30)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6013
	    'SGIGray16'     (40 40 40)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6014
	    'SGIGray20'     (51 51 51)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6015
	    'SGIGray24'     (61 61 61)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6016
	    'SGIGray28'     (71 71 71)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6017
	    'SGIGray32'     (81 81 81)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6018
	    'SGIGray36'     (91 91 91)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6019
	    'SGIGray4'      (10 10 10)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6020
	    'SGIGray40'     (102 102 102)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6021
	    'SGIGray44'     (112 112 112)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6022
	    'SGIGray48'     (122 122 122)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6023
	    'SGIGray52'     (132 132 132)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6024
	    'SGIGray56'     (142 142 142)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6025
	    'SGIGray60'     (153 153 153)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6026
	    'SGIGray64'     (163 163 163)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6027
	    'SGIGray68'     (173 173 173)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6028
	    'SGIGray72'     (183 183 183)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6029
	    'SGIGray76'     (193 193 193)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6030
	    'SGIGray8'      (20 20 20)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6031
	    'SGIGray80'     (204 204 204)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6032
	    'SGIGray84'     (214 214 214)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6033
	    'SGIGray88'     (224 224 224)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6034
	    'SGIGray92'     (234 234 234)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6035
	    'SGIGray96'     (244 244 244)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6036
	    'SGIGrey0'      (0 0 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6037
	    'SGIGrey100'    (255 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6038
	    'SGIGrey12'     (30 30 30)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6039
	    'SGIGrey16'     (40 40 40)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6040
	    'SGIGrey20'     (51 51 51)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6041
	    'SGIGrey24'     (61 61 61)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6042
	    'SGIGrey28'     (71 71 71)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6043
	    'SGIGrey32'     (81 81 81)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6044
	    'SGIGrey36'     (91 91 91)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6045
	    'SGIGrey4'      (10 10 10)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6046
	    'SGIGrey40'     (102 102 102)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6047
	    'SGIGrey44'     (112 112 112)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6048
	    'SGIGrey48'     (122 122 122)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6049
	    'SGIGrey52'     (132 132 132)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6050
	    'SGIGrey56'     (142 142 142)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6051
	    'SGIGrey60'     (153 153 153)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6052
	    'SGIGrey64'     (163 163 163)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6053
	    'SGIGrey68'     (173 173 173)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6054
	    'SGIGrey72'     (183 183 183)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6055
	    'SGIGrey76'     (193 193 193)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6056
	    'SGIGrey8'      (20 20 20)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6057
	    'SGIGrey80'     (204 204 204)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6058
	    'SGIGrey84'     (214 214 214)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6059
	    'SGIGrey88'     (224 224 224)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6060
	    'SGIGrey92'     (234 234 234)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6061
	    'SGIGrey96'     (244 244 244)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6062
	    'SGILightBlue'  (125 158 192)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6063
	    'SGILightGray'  (170 170 170)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6064
	    'SGILightGrey'  (170 170 170)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6065
	    'SGIMediumGray' (132 132 132)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6066
	    'SGIMediumGrey' (132 132 132)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6067
	    'SGIOliveDrab'  (142 142 56)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6068
	    'SGISalmon'     (198 113 113)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6069
	    'SGISlateBlue'  (113 113 198)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6070
	    'SGITeal'       (56 142 142)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6071
	    'SGIVeryDarkGray'       (40 40 40)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6072
	    'SGIVeryDarkGrey'       (40 40 40)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6073
	    'SGIVeryLightGray'      (214 214 214)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6074
	    'SGIVeryLightGrey'      (214 214 214)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6075
	    'sienna'        (160 82 45)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6076
	    'sienna1'       (255 130 71)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6077
	    'sienna2'       (238 121 66)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6078
	    'sienna3'       (205 104 57)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6079
	    'sienna4'       (139 71 38)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6080
	    'skyblue'       (135 206 235)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6081
	    'SkyBlue1'      (135 206 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6082
	    'SkyBlue2'      (126 192 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6083
	    'SkyBlue3'      (108 166 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6084
	    'SkyBlue4'      (74 112 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6085
	    'slategray'     (112 128 144)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6086
	    'slategrey'     (112 128 144)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6087
	    'slateblue'     (106 90 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6088
	    'SlateBlue1'    (131 111 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6089
	    'SlateBlue2'    (122 103 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6090
	    'SlateBlue3'    (105 89 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6091
	    'SlateBlue4'    (71 60 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6092
	    'SlateGray1'    (198 226 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6093
	    'SlateGray2'    (185 211 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6094
	    'SlateGray3'    (159 182 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6095
	    'SlateGray4'    (108 123 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6096
	    'snow'          (255 250 250)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6097
	    'snow1'         (255 250 250)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6098
	    'snow2'         (238 233 233)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6099
	    'snow3'         (205 201 201)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6100
	    'snow4'         (139 137 137)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6101
	    'springgreen'   (0 255 127)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6102
	    'SpringGreen1'  (0 255 127)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6103
	    'SpringGreen2'  (0 238 118)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6104
	    'SpringGreen3'  (0 205 102)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6105
	    'SpringGreen4'  (0 139 69)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6106
	    'steelblue'     (70 130 180)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6107
	    'SteelBlue1'    (99 184 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6108
	    'SteelBlue2'    (92 172 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6109
	    'SteelBlue3'    (79 148 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6110
	    'SteelBlue4'    (54 100 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6111
	    'tan'   (210 180 140)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6112
	    'tan1'  (255 165 79)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6113
	    'tan2'  (238 154 73)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6114
	    'tan3'  (205 133 63)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6115
	    'tan4'  (139 90 43)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6116
	    'thistle'       (216 191 216)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6117
	    'thistle1'      (255 225 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6118
	    'thistle2'      (238 210 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6119
	    'thistle3'      (205 181 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6120
	    'thistle4'      (139 123 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6121
	    'tomato'        (255 99 71)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6122
	    'tomato1'       (255 99 71)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6123
	    'tomato2'       (238 92 66)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6124
	    'tomato3'       (205 79 57)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6125
	    'tomato4'       (139 54 38)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6126
	    'turquoise'     (64 224 208)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6127
	    'turquoise1'    (0 245 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6128
	    'turquoise2'    (0 229 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6129
	    'turquoise3'    (0 197 205)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6130
	    'turquoise4'    (0 134 139)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6131
	    'violet'        (238 130 238)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6132
	    'violetred'     (208 32 144)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6133
	    'VioletRed1'    (255 62 150)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6134
	    'VioletRed2'    (238 58 140)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6135
	    'VioletRed3'    (205 50 120)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6136
	    'VioletRed4'    (139 34 82)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6137
	    'wheat'         (245 222 179)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6138
	    'wheat1'        (255 231 186)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6139
	    'wheat2'        (238 216 174)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6140
	    'wheat3'        (205 186 150)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6141
	    'wheat4'        (139 126 102)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6142
	    'white'         (255 255 255)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6143
	    'whitesmoke'    (245 245 245)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6144
	    'yellow'        (255 255 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6145
	    'yellowgreen'   (154 205 50)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6146
	    'yellow1'       (255 255 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6147
	    'yellow2'       (238 238 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6148
	    'yellow3'       (205 205 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6149
	    'yellow4'       (139 139 0)
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6150
	).
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6151
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6152
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6153
     WinWorkstation initializeStandardColorNames
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6154
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6155
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6156
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6157
!WinWorkstation class methodsFor:'debugging'!
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6158
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6159
bitmapHandleCounts
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6160
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6161
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6162
%{  /* NOCONTEXT */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6163
#ifdef COUNT_BMP_RESOURCES
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6164
    RETURN ( __MKSMALLINT(__cnt_bitmap));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6165
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6166
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6167
#endif
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6168
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6169
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6170
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6171
cursorHandleCounts
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6172
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6173
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6174
%{  /* NOCONTEXT */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6175
#ifdef COUNT_RESOURCES
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6176
    RETURN ( __MKSMALLINT(__cnt_cur));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6177
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6178
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6179
#endif
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6180
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6181
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6182
4265
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6183
debug
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6184
%{  /* NOCONTEXT */
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6185
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6186
    RETURN (__debug__ != 0 ? true : false);
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6187
%}
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6188
!
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  6189
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
  6190
debug2
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  6191
%{  /* NOCONTEXT */
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  6192
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  6193
    RETURN ((__debug__ & 2) != 0 ? true : false);
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  6194
%}
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  6195
!
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  6196
6007
0400ac2a7eb3 class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6004
diff changeset
  6197
debug2:aBoolean
0400ac2a7eb3 class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6004
diff changeset
  6198
    "enable more debug prints - this will vanish"
0400ac2a7eb3 class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6004
diff changeset
  6199
0400ac2a7eb3 class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6004
diff changeset
  6200
%{  /* NOCONTEXT */
0400ac2a7eb3 class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6004
diff changeset
  6201
0400ac2a7eb3 class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6004
diff changeset
  6202
    if (aBoolean == true) {
0400ac2a7eb3 class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6004
diff changeset
  6203
	__debug__ |= 2;
0400ac2a7eb3 class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6004
diff changeset
  6204
    } else {
0400ac2a7eb3 class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6004
diff changeset
  6205
	__debug__ &= ~2;
0400ac2a7eb3 class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6004
diff changeset
  6206
    }
0400ac2a7eb3 class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6004
diff changeset
  6207
%}
0400ac2a7eb3 class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6004
diff changeset
  6208
!
0400ac2a7eb3 class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6004
diff changeset
  6209
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6210
debug4:aBoolean
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6211
    "enable even more debug prints - this will vanish"
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6212
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6213
%{  /* NOCONTEXT */
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6214
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6215
    if (aBoolean == true) {
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6216
	__debug__ |= 4;
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6217
    } else {
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6218
	__debug__ &= ~4;
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6219
    }
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6220
%}
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6221
!
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6222
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6223
debug8:aBoolean
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6224
    "enable even more debug prints - this will vanish"
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6225
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6226
%{  /* NOCONTEXT */
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6227
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6228
    if (aBoolean == true) {
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6229
	__debug__ |= 8;
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6230
    } else {
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6231
	__debug__ &= ~8;
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6232
    }
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6233
%}
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6234
!
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6235
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6236
debug:aBoolean
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6237
    "enable/disable debug prints - this will vanish"
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6238
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6239
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6240
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6241
    __debug__ = (aBoolean == true) ? 1 : 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6242
%}
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6243
    "
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6244
     WinWorkstation debug:true
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6245
     WinWorkstation debug:false
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6246
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6247
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6248
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6249
debug:aBoolean message:msg
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  6250
    "enable/disable debugging of individual WM messages"
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  6251
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  6252
    msg = 'WM_ALL' ifTrue:[
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  6253
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6254
	__debug_WM_ALL__ = (aBoolean == true);
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  6255
	RETURN (self);
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  6256
%}
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  6257
    ].
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6258
    msg = 'WM_USER' ifTrue:[
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6259
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6260
	__debug_WM_MOUSEENTER__ = (aBoolean == true);
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6261
	__debug_WM_MOUSELEAVE__ = (aBoolean == true);
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6262
	__debug_WM_MOUSEMOVE__ = (aBoolean == true);
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6263
	__debug_WM_MOUSEACTIVATE__ = (aBoolean == true);
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6264
	__debug_WM_BUTTONUP__ = (aBoolean == true);
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6265
	__debug_WM_BUTTONDOWN__ = (aBoolean == true);
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6266
	__debug_WM_KEYUP__ = (aBoolean == true);
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6267
	__debug_WM_KEYDOWN__ = (aBoolean == true);
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6268
	__debug_WM_CHAR__ = (aBoolean == true);
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6269
	RETURN (self);
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6270
%}
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6271
    ].
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6272
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6273
    msg = 'WM_MOUSEENTER' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6274
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6275
	__debug_WM_MOUSEENTER__ = (aBoolean == true);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6276
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6277
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6278
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6279
    msg = 'WM_MOUSELEAVE' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6280
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6281
	__debug_WM_MOUSELEAVE__ = (aBoolean == true);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6282
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6283
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6284
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6285
    msg = 'WM_MOUSEMOVE' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6286
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6287
	__debug_WM_MOUSEMOVE__ = (aBoolean == true);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6288
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6289
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6290
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6291
    msg = 'WM_MOUSEACTIVATE' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6292
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6293
	__debug_WM_MOUSEACTIVATE__ = (aBoolean == true);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6294
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6295
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6296
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6297
    msg = 'WM_BUTTONUP' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6298
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6299
	__debug_WM_BUTTONUP__ = (aBoolean == true);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6300
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6301
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6302
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6303
    msg = 'WM_BUTTONDOWN' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6304
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6305
	__debug_WM_BUTTONDOWN__ = (aBoolean == true);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6306
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6307
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6308
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6309
    msg = 'WM_KEYUP' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6310
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6311
	__debug_WM_KEYUP__ = (aBoolean == true);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6312
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6313
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6314
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6315
    msg = 'WM_KEYDOWN' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6316
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6317
	__debug_WM_KEYDOWN__ = (aBoolean == true);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6318
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6319
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6320
    ].
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6321
    msg = 'WM_CHAR' ifTrue:[
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6322
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6323
	__debug_WM_CHAR__ = (aBoolean == true);
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6324
	RETURN (self);
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6325
%}
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6326
    ].
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6327
    msg = 'WM_PAINT' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6328
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6329
	__debug_WM_PAINT__ = (aBoolean == true);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6330
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6331
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6332
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6333
    msg = 'WM_MOVING' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6334
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6335
	__debug_WM_MOVING__ = (aBoolean == true);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6336
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6337
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6338
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6339
    msg = 'WM_ERASEBKGND' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6340
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6341
	__debug_WM_ERASEBKGND__ = (aBoolean == true);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6342
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6343
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6344
    ].
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6345
    msg = 'WM_SETTEXT' ifTrue:[
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6346
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6347
	__debug_WM_SETTEXT__ = (aBoolean == true);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6348
	RETURN (self);
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6349
%}
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6350
    ].
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
  6351
    msg = 'WM_COPYDATA' ifTrue:[
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
  6352
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6353
	__debug_WM_COPYDATA__ = (aBoolean == true);
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
  6354
	RETURN (self);
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
  6355
%}
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
  6356
    ].
5230
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6357
    msg = 'WM_DROPFILES' ifTrue:[
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6358
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6359
	__debug_WM_DROPFILES__ = (aBoolean == true);
5230
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6360
	RETURN (self);
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6361
%}
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6362
    ].
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6363
    msg = 'WM_SHOWWINDOW' ifTrue:[
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6364
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6365
	__debug_WM_SHOWWINDOW__ = (aBoolean == true);
5230
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6366
	RETURN (self);
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6367
%}
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
  6368
    ].
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6369
    msg = 'WM_SETCURSOR' ifTrue:[
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6370
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6371
	__debug_WM_SETCURSOR__ = (aBoolean == true);
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  6372
	RETURN (self);
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  6373
%}
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  6374
    ].
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6375
    msg = 'WM_FOCUS' ifTrue:[
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6376
%{
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6377
	__debug_WM_FOCUS__ = (aBoolean == true);
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6378
	RETURN (self);
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6379
%}
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6380
    ].
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  6381
    'unknown WM_x' infoPrintCR.
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6382
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6383
    "
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6384
     WinWorkstation debug:true
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6385
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6386
     WinWorkstation debug:false message:'WM_KEYUP'
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6387
     WinWorkstation debug:false message:'WM_KEYDOWN'
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6388
     WinWorkstation debug:false message:'WM_PAINT'
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  6389
     WinWorkstation debug:false message:'WM_BUTTONDOWN'
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6390
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6391
     WinWorkstation debug:true message:'WM_KEYUP'
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6392
     WinWorkstation debug:true message:'WM_KEYDOWN'
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
  6393
     WinWorkstation debug:true message:'WM_CHAR'
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6394
     WinWorkstation debug:true message:'WM_COPYDATA'
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  6395
    "
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  6396
!
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  6397
4248
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6398
debugNative
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6399
%{  /* NOCONTEXT */
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6400
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6401
    RETURN (__debugNative__ == 0 ? false : true);
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6402
%}
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6403
    "
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6404
     WinWorkstation debugNative
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6405
    "
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6406
!
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
  6407
4236
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6408
debugNative:aBoolean
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6409
%{  /* NOCONTEXT */
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6410
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6411
    __debugNative__ = (aBoolean == true);
4236
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6412
%}
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6413
    "
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6414
     WinWorkstation debugNative:true
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6415
     WinWorkstation debugNative:false
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6416
    "
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6417
!
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
  6418
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6419
fontHandleCounts
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6420
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6421
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6422
%{  /* NOCONTEXT */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6423
#ifdef COUNT_RESOURCES
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6424
    RETURN ( __MKSMALLINT(__cnt_font));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6425
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6426
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6427
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6428
%}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6429
!
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6430
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6431
gcDataHandleCounts
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6432
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6433
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6434
%{  /* NOCONTEXT */
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6435
#ifdef COUNT_RESOURCES
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6436
    RETURN ( __MKSMALLINT(__cnt_gcData));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6437
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6438
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6439
#endif
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6440
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6441
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  6442
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6443
printHandleCounts
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6444
   "show prim values"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  6445
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6446
    'WINWORKSTATION: pWin=' print. self windowHandleCounts print.
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6447
    ' pBit=' print. self bitmapHandleCounts print.
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6448
    ' pGc=' print. self gcDataHandleCounts print.
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
  6449
    ' pCurs=' print. self cursorHandleCounts printCR
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6450
!
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6451
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  6452
windowHandleCounts
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6453
    "for resource debugging only - will vanish"
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6454
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6455
%{  /* NOCONTEXT */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6456
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6457
    RETURN ( __MKSMALLINT(__cnt_createWindows));
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6458
#else
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6459
    RETURN (nil);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  6460
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6461
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6462
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6463
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6464
!WinWorkstation class methodsFor:'queries'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6465
6361
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  6466
isWindowsPlatform
6376
73ebac4ef970 comment
Claus Gittinger <cg@exept.de>
parents: 6361
diff changeset
  6467
    "return true, if this device is a windows screen"
73ebac4ef970 comment
Claus Gittinger <cg@exept.de>
parents: 6361
diff changeset
  6468
6361
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  6469
    ^ true
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  6470
!
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  6471
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6472
platformName
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6473
    "ST-80 compatibility.
2777
60ba83db1fab comment
Claus Gittinger <cg@exept.de>
parents: 2766
diff changeset
  6474
     Return a string describing the display systems platform.
60ba83db1fab comment
Claus Gittinger <cg@exept.de>
parents: 2766
diff changeset
  6475
     WinWorkstation always returns 'WIN32'."
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6476
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6477
    ^ 'WIN32'
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6478
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6479
    "Modified: 26.5.1996 / 15:32:46 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6480
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6481
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6482
!WinWorkstation methodsFor:'accessing & queries'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6483
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6484
activateOnClick:aBoolean
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6485
    "set/clear the activateOnClick behavior.
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6486
     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
  6487
     the window.
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6488
     Windows users typically enable this;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6489
     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
  6490
     it disabled.
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6491
     Returns the previous setting.
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6492
     The default is true."
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6493
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6494
%{  /* NOCONTEXT */
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6495
    OBJ rslt = __activateOnClick ? true : false;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6496
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6497
    if (aBoolean == true) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6498
       __activateOnClick = 1;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6499
    } else {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6500
       if (aBoolean == false) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6501
	   __activateOnClick = 0;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6502
       }
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6503
    }
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6504
    RETURN (rslt);
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6505
%}
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
  6506
    "
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  6507
     Display activateOnClick:true
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  6508
     Display activateOnClick:false
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  6509
    "
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  6510
!
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
  6511
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6512
anyButtonMotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6513
    "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
  6514
     This is the devices mask."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6515
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6516
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6517
    RETURN ( __MKSMALLINT(Button1MotionMask | Button2MotionMask | Button3MotionMask));
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6518
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6519
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6520
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6521
blackpixel
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6522
    "return the colornumber of black"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6523
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6524
    ^ blackpixel
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6525
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6526
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6527
button1MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6528
    "return the state-mask for button1 in motion events' state-field.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6529
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6530
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6531
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  6532
    RETURN (__MKSMALLINT(Button1MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6533
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6534
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6535
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6536
     Display button1MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6537
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6538
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6539
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6540
button2MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6541
    "return the state-mask for button2 in motion events' state-field
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6542
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6543
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6544
%{  /* NOCONTEXT */
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6545
    RETURN (__MKSMALLINT(Button2MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6546
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6547
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6548
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6549
button3MotionMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6550
    "return the state-mask for button3 in motion events' state-field
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6551
     For backward compatibility."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6552
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6553
%{  /* NOCONTEXT */
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6554
    RETURN (__MKSMALLINT(Button3MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6555
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6556
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6557
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6558
buttonMotionMask:aButton
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6559
    "return the state-mask for button1 in motion events state-field.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6560
     This is the devices mask."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6561
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6562
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6563
    if (aButton == __MKSMALLINT(1)) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6564
	RETURN (__MKSMALLINT(Button1MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6565
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6566
    if (aButton == __MKSMALLINT(2)) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6567
	RETURN (__MKSMALLINT(Button2MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6568
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6569
    if (aButton == __MKSMALLINT(3)) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6570
	RETURN (__MKSMALLINT(Button3MotionMask));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6571
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6572
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6573
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6574
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6575
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6576
controlMask
3261
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6577
    "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
  6578
     Obsolete"
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6579
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6580
%{  /* NOCONTEXT */
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6581
    RETURN (__MKSMALLINT(ControlMask));
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6582
%}
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6583
!
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6584
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  6585
ctrlModifierMask
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6586
    "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
  6587
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6588
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6589
    RETURN (__MKSMALLINT(ControlMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6590
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6591
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6592
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6593
defaultEventMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6594
    "return a mask to enable some events by default."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6595
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6596
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6597
    RETURN (__MKSMALLINT( ExposureMask | StructureNotifyMask |
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6598
			 KeyPressMask | KeyReleaseMask |
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6599
			 EnterWindowMask | LeaveWindowMask |
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6600
			 ButtonPressMask | ButtonMotionMask | ButtonReleaseMask ));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  6601
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6602
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6603
5672
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  6604
deviceContext
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  6605
    ^ rootDC
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  6606
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  6607
    "Created: / 24-12-2010 / 10:44:40 / cg"
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  6608
!
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  6609
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6610
displayFileDescriptor
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6611
    "return the displays fileNumber for select, if any"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6612
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6613
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6614
   /* RETURN (nil);*/
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6615
   RETURN ( __MKEXTERNALADDRESS(hInputEvent));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6616
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6617
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6618
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6619
displayName
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6620
    "return the display-connections display name.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  6621
     For Windows, a dummy name is returned"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6622
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  6623
    ^ 'local'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6624
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6625
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6626
focusFollowsMouse:aBoolean
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6627
    "set/clear the focusFollowsMouse behavior.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6628
     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
  6629
     (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
  6630
      the groups focusView...).
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6631
     Windows users typically disable this;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6632
     users which are used to the X-Window system typically prefer
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6633
     it enabled.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6634
     Returns the previous setting.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6635
     The default is false."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6636
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6637
%{  /* NOCONTEXT */
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6638
    OBJ rslt = __focusFollowsMouse ? true : false;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6639
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6640
    if (aBoolean == true) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6641
       __focusFollowsMouse = 1;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6642
    } else {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6643
       if (aBoolean == false) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6644
	   __focusFollowsMouse = 0;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6645
       }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6646
    }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6647
    RETURN (rslt);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6648
%}
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6649
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6650
     WinWorkstation focusFollowsMouse:true
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6651
     WinWorkstation focusFollowsMouse:false
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6652
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6653
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6654
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  6655
getSystemColor:aKey
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6656
    "retrieve a windows system color.
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6657
     The styleSheet/View classes may use this to setup default colors"
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6658
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  6659
    ^ SystemColorValues at:aKey ifAbsentPut:[self primGetSystemColor:aKey].
2298
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6660
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6661
    "
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6662
     Display getSystemColor:#COLOR_WINDOW
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6663
     Display getSystemColor:#COLOR_HIGHLIGHT
0b4a9634b79c added getSystemColor interface
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
  6664
    "
4809
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6665
27b6b61daa24 preps for tray access
Claus Gittinger <cg@exept.de>
parents: 4804
diff changeset
  6666
    "Modified: / 30-10-2007 / 15:06:02 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6667
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  6668
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6669
getSystemMetrics:aNumberOrSymbol
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6670
    "get a system metrics value;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6671
     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
  6672
     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
  6673
     which must be the define-value."
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6674
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6675
%{  /* NOCONTEXT */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6676
    int info = 0;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6677
    int isBool = 0;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6678
    int arg;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6679
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6680
    if (__isSmallInteger(aNumberOrSymbol)) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6681
	arg = __intVal(aNumberOrSymbol);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6682
    } else if ((aNumberOrSymbol == @symbol(swapButton)) || (aNumberOrSymbol == @symbol(SM_SWAPBUTTON))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6683
	arg = SM_SWAPBUTTON;
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6684
	isBool = 1;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6685
    } else if ((aNumberOrSymbol == @symbol(mousePresent)) || (aNumberOrSymbol == @symbol(SM_MOUSEPRESENT))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6686
	arg = SM_MOUSEPRESENT;
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6687
	isBool = 1;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6688
    } else if ((aNumberOrSymbol == @symbol(mouseButtons)) || (aNumberOrSymbol == @symbol(SM_CMOUSEBUTTONS))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6689
	arg = SM_CMOUSEBUTTONS;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6690
    } else if ((aNumberOrSymbol == @symbol(iconWidth)) || (aNumberOrSymbol == @symbol(SM_CXICON))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6691
	arg = SM_CXICON;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6692
    } else if ((aNumberOrSymbol == @symbol(iconHeight)) || (aNumberOrSymbol == @symbol(SM_CYICON))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6693
	arg = SM_CYICON;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  6694
    } else if ((aNumberOrSymbol == @symbol(iconWidth)) || (aNumberOrSymbol == @symbol(SM_CXDOUBLECLK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6695
	arg = SM_CXDOUBLECLK;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  6696
    } else if ((aNumberOrSymbol == @symbol(iconHeight)) || (aNumberOrSymbol == @symbol(SM_CYDOUBLECLK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6697
	arg = SM_CYDOUBLECLK;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6698
    } else if ((aNumberOrSymbol == @symbol(cursorWidth)) || (aNumberOrSymbol == @symbol(SM_CXCURSOR))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6699
	arg = SM_CXCURSOR;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6700
    } else if ((aNumberOrSymbol == @symbol(cursorHeight)) || (aNumberOrSymbol == @symbol(SM_CYCURSOR))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6701
	arg = SM_CYCURSOR;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6702
    } else if ((aNumberOrSymbol == @symbol(captionHeight)) || (aNumberOrSymbol == @symbol(SM_CYCAPTION))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6703
	arg = SM_CYCAPTION;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6704
    } else if ((aNumberOrSymbol == @symbol(resizeFrameWidth)) || (aNumberOrSymbol == @symbol(SM_CXFRAME))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6705
	arg = SM_CXFRAME;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6706
    } else if ((aNumberOrSymbol == @symbol(resizeFrameHeight)) || (aNumberOrSymbol == @symbol(SM_CYFRAME))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6707
	arg = SM_CYFRAME;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6708
    } else if ((aNumberOrSymbol == @symbol(borderFrameWidth)) || (aNumberOrSymbol == @symbol(SM_CXBORDER))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6709
	arg = SM_CXBORDER;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6710
    } else if ((aNumberOrSymbol == @symbol(borderFrameHeight)) || (aNumberOrSymbol == @symbol(SM_CYBORDER))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6711
	arg = SM_CYBORDER;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6712
    } else if (aNumberOrSymbol == @symbol(SM_CXDLGFRAME)) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6713
	arg = SM_CXDLGFRAME;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6714
    } else if (aNumberOrSymbol == @symbol(SM_CYDLGFRAME)) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6715
	arg = SM_CYDLGFRAME;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6716
    } else if ((aNumberOrSymbol == @symbol(fullScreenWindowWidth)) || (aNumberOrSymbol == @symbol(SM_CXFULLSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6717
	arg = SM_CXFULLSCREEN;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6718
    } else if ((aNumberOrSymbol == @symbol(fullScreenWindowHeight)) || (aNumberOrSymbol == @symbol(SM_CYFULLSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6719
	arg = SM_CYFULLSCREEN;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6720
    } else if ((aNumberOrSymbol == @symbol(screenWidth)) || (aNumberOrSymbol == @symbol(SM_CXSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6721
	arg = SM_CXSCREEN;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6722
    } else if ((aNumberOrSymbol == @symbol(screenHeight)) || (aNumberOrSymbol == @symbol(SM_CYSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6723
	arg = SM_CYSCREEN;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6724
    } else if ((aNumberOrSymbol == @symbol(minWindowWidth)) || (aNumberOrSymbol == @symbol(SM_CXMIN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6725
	arg = SM_CXMIN;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6726
    } else if ((aNumberOrSymbol == @symbol(minWindowHeight)) || (aNumberOrSymbol == @symbol(SM_CYMIN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6727
	arg = SM_CYMIN;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6728
    } else if ((aNumberOrSymbol == @symbol(vScrollbarWidth)) || (aNumberOrSymbol == @symbol(SM_CXVSCROLL))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6729
	arg = SM_CXVSCROLL;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6730
    } else if ((aNumberOrSymbol == @symbol(hScrollbarHeight)) || (aNumberOrSymbol == @symbol(SM_CYHSCROLL))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6731
	arg = SM_CYHSCROLL;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6732
    } else if ((aNumberOrSymbol == @symbol(vThumbHeight)) || (aNumberOrSymbol == @symbol(SM_CYVTHUMB))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6733
	arg = SM_CYVTHUMB;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6734
    } else if ((aNumberOrSymbol == @symbol(hThumbWidth)) || (aNumberOrSymbol == @symbol(SM_CXHTHUMB))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6735
	arg = SM_CXHTHUMB;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6736
    } else if ((aNumberOrSymbol == @symbol(SM_CXSIZE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6737
	arg = SM_CXSIZE;
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  6738
    } else if ((aNumberOrSymbol == @symbol(SM_CYSIZE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6739
	arg = SM_CYSIZE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6740
    } else if ((aNumberOrSymbol == @symbol(SM_CYVSCROLL))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6741
	arg = SM_CYVSCROLL;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6742
    } else if ((aNumberOrSymbol == @symbol(SM_CXHSCROLL))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6743
	arg = SM_CXHSCROLL;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6744
    } else if ((aNumberOrSymbol == @symbol(SM_CXMINTRACK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6745
	arg = SM_CXMINTRACK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6746
    } else if ((aNumberOrSymbol == @symbol(SM_CYMINTRACK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6747
	arg = SM_CYMINTRACK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6748
    } else if ((aNumberOrSymbol == @symbol(SM_CXICONSPACING))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6749
	arg = SM_CXICONSPACING;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6750
    } else if ((aNumberOrSymbol == @symbol(SM_CYICONSPACING))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6751
	arg = SM_CYICONSPACING;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6752
    } else if ((aNumberOrSymbol == @symbol(SM_CYMENU))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6753
	arg = SM_CYMENU;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6754
    } else if ((aNumberOrSymbol == @symbol(SM_MENUDROPALIGNMENT))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6755
	arg = SM_MENUDROPALIGNMENT;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6756
    } else if ((aNumberOrSymbol == @symbol(SM_PENWINDOWS))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6757
	arg = SM_PENWINDOWS;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6758
    } else if ((aNumberOrSymbol == @symbol(SM_DBCSENABLED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6759
	arg = SM_DBCSENABLED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6760
    } else if ((aNumberOrSymbol == @symbol(SM_CXFIXEDFRAME))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6761
	arg = SM_CXFIXEDFRAME;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6762
    } else if ((aNumberOrSymbol == @symbol(SM_CYFIXEDFRAME))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6763
	arg = SM_CYFIXEDFRAME;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6764
    } else if ((aNumberOrSymbol == @symbol(SM_CXSIZEFRAME))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6765
	arg = SM_CXSIZEFRAME;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6766
    } else if ((aNumberOrSymbol == @symbol(SM_CYSIZEFRAME))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6767
	arg = SM_CYSIZEFRAME;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6768
    } else if ((aNumberOrSymbol == @symbol(SM_CYKANJIWINDOW))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6769
	arg = SM_CYKANJIWINDOW;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6770
    } else if ((aNumberOrSymbol == @symbol(SM_SECURE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6771
	arg = SM_SECURE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6772
    } else if ((aNumberOrSymbol == @symbol(SM_CXEDGE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6773
	arg = SM_CXEDGE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6774
    } else if ((aNumberOrSymbol == @symbol(SM_CYEDGE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6775
	arg = SM_CYEDGE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6776
    } else if ((aNumberOrSymbol == @symbol(SM_CXMINSPACING))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6777
	arg = SM_CXMINSPACING;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6778
    } else if ((aNumberOrSymbol == @symbol(SM_CYMINSPACING))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6779
	arg = SM_CYMINSPACING;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6780
    } else if ((aNumberOrSymbol == @symbol(SM_CXSMICON))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6781
	arg = SM_CXSMICON;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6782
    } else if ((aNumberOrSymbol == @symbol(SM_CYSMICON))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6783
	arg = SM_CYSMICON;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6784
    } else if ((aNumberOrSymbol == @symbol(SM_CYSMCAPTION))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6785
	arg = SM_CYSMCAPTION;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6786
    } else if ((aNumberOrSymbol == @symbol(SM_CXSMSIZE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6787
	arg = SM_CXSMSIZE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6788
    } else if ((aNumberOrSymbol == @symbol(SM_CYSMSIZE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6789
	arg = SM_CYSMSIZE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6790
    } else if ((aNumberOrSymbol == @symbol(SM_CXMENUSIZE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6791
	arg = SM_CXMENUSIZE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6792
    } else if ((aNumberOrSymbol == @symbol(SM_CYMENUSIZE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6793
	arg = SM_CYMENUSIZE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6794
    } else if ((aNumberOrSymbol == @symbol(SM_ARRANGE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6795
	arg = SM_ARRANGE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6796
    } else if ((aNumberOrSymbol == @symbol(SM_CXMINIMIZED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6797
	arg = SM_CXMINIMIZED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6798
    } else if ((aNumberOrSymbol == @symbol(SM_CYMINIMIZED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6799
	arg = SM_CYMINIMIZED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6800
    } else if ((aNumberOrSymbol == @symbol(SM_CXMAXTRACK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6801
	arg = SM_CXMAXTRACK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6802
    } else if ((aNumberOrSymbol == @symbol(SM_CYMAXTRACK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6803
	arg = SM_CYMAXTRACK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6804
    } else if ((aNumberOrSymbol == @symbol(SM_CXMAXIMIZED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6805
	arg = SM_CXMAXIMIZED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6806
    } else if ((aNumberOrSymbol == @symbol(SM_CYMAXIMIZED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6807
	arg = SM_CYMAXIMIZED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6808
    } else if ((aNumberOrSymbol == @symbol(SM_NETWORK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6809
	arg = SM_NETWORK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6810
    } else if ((aNumberOrSymbol == @symbol(SM_CXDRAG))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6811
	arg = SM_CXDRAG;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6812
    } else if ((aNumberOrSymbol == @symbol(SM_CYDRAG))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6813
	arg = SM_CYDRAG;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6814
    } else if ((aNumberOrSymbol == @symbol(SM_NETWORK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6815
	arg = SM_NETWORK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6816
    } else if ((aNumberOrSymbol == @symbol(SM_SHOWSOUNDS))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6817
	arg = SM_SHOWSOUNDS;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6818
    } else if ((aNumberOrSymbol == @symbol(SM_CXMENUCHECK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6819
	arg = SM_CXMENUCHECK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6820
    } else if ((aNumberOrSymbol == @symbol(SM_CYMENUCHECK))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6821
	arg = SM_CYMENUCHECK;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6822
    } else if ((aNumberOrSymbol == @symbol(SM_SLOWMACHINE))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6823
	arg = SM_SLOWMACHINE;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6824
    } else if ((aNumberOrSymbol == @symbol(SM_MIDEASTENABLED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6825
	arg = SM_MIDEASTENABLED;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6826
    } else if ((aNumberOrSymbol == @symbol(SM_MOUSEWHEELPRESENT))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6827
	arg = SM_MOUSEWHEELPRESENT;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6828
    } else if ((aNumberOrSymbol == @symbol(SM_XVIRTUALSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6829
	arg = SM_XVIRTUALSCREEN;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6830
    } else if ((aNumberOrSymbol == @symbol(SM_YVIRTUALSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6831
	arg = SM_YVIRTUALSCREEN;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6832
    } else if ((aNumberOrSymbol == @symbol(SM_CXVIRTUALSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6833
	arg = SM_CXVIRTUALSCREEN;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6834
    } else if ((aNumberOrSymbol == @symbol(SM_CYVIRTUALSCREEN))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6835
	arg = SM_CYVIRTUALSCREEN;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6836
    } else if ((aNumberOrSymbol == @symbol(SM_CMONITORS))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6837
	arg = SM_CMONITORS;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6838
    } else if ((aNumberOrSymbol == @symbol(SM_SAMEDISPLAYFORMAT))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6839
	arg = SM_SAMEDISPLAYFORMAT;
4092
9a7cf8cf8329 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4089
diff changeset
  6840
#ifdef SM_IMMENABLED
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6841
    } else if ((aNumberOrSymbol == @symbol(SM_IMMENABLED))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6842
	arg = SM_IMMENABLED;
4092
9a7cf8cf8329 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4089
diff changeset
  6843
#endif
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6844
    } else if ((aNumberOrSymbol == @symbol(SM_DEBUG))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6845
	arg = SM_DEBUG;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6846
#ifdef SM_REMOTESESSION
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6847
    } else if ((aNumberOrSymbol == @symbol(SM_REMOTESESSION))) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6848
	arg = SM_REMOTESESSION;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6849
#endif
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6850
    } else {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6851
	RETURN (nil);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6852
    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6853
    info = GetSystemMetrics(arg);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6854
    if (isBool) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  6855
	RETURN (info ? true : false);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6856
    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6857
    RETURN (__MKSMALLINT(info));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6858
%}
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6859
    "
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6860
     Screen current getSystemMetrics:#SM_MOUSEWHEELPRESENT
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6861
     Screen current getSystemMetrics:#SM_ARRANGE
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  6862
     Screen current getSystemMetrics:#SM_XVIRTUALSCREEN
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  6863
     Screen current getSystemMetrics:#SM_CXVIRTUALSCREEN
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  6864
     Screen current getSystemMetrics:#SM_CYVIRTUALSCREEN
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  6865
     Screen current getSystemMetrics:#SM_CMONITORS
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  6866
     Screen current getSystemMetrics:#SM_SAMEDISPLAYFORMAT
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  6867
     Screen current getSystemMetrics:81
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  6868
    "
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  6869
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  6870
    "Modified: / 08-09-2006 / 15:36:32 / cg"
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6871
!
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6872
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6873
getSystemParametersInfo:aNumberOrSymbol
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6874
    "get a system parameter value;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6875
     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
  6876
     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
  6877
     which must be the define-value."
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6878
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6879
    | info menuFontInfoArray statusFontInfoArray messageFontInfoArray
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6880
      menuFont statusFont messageFont |
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6881
%{
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6882
    int retVal = 0;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6883
    int isBool = 0;
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6884
    int isString = 0;
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6885
    int isRect = 0;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6886
    int isNonClientInfo = 0;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6887
    int arg, param;
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6888
    void *pRslt;
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6889
    union {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6890
	char buffer[1024];
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6891
	RECT rect;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6892
	NONCLIENTMETRICS nc;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6893
    } rslt;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6894
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6895
    if (__isSmallInteger(aNumberOrSymbol)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6896
	arg = __intVal(aNumberOrSymbol);
4092
9a7cf8cf8329 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4089
diff changeset
  6897
#ifdef SPI_GETDESKWALLPAPER
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6898
    } else if (aNumberOrSymbol == @symbol(SPI_GETDESKWALLPAPER)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6899
	arg = SPI_GETDESKWALLPAPER;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6900
	isString = 1;
4092
9a7cf8cf8329 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4089
diff changeset
  6901
#endif
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6902
#ifdef SPI_GETDROPSHADOW
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6903
    } else if (aNumberOrSymbol == @symbol(SPI_GETDROPSHADOW)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6904
	arg = SPI_GETDROPSHADOW;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6905
	isBool = 1;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6906
#endif
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6907
#ifdef SPI_GETFLATMENU
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6908
    } else if (aNumberOrSymbol == @symbol(SPI_GETFLATMENU)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6909
	arg = SPI_GETFLATMENU;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6910
	isBool = 1;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6911
#endif
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6912
#ifdef SPI_GETWHEELSCROLLLINES
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6913
    } else if (aNumberOrSymbol == @symbol(SPI_GETWHEELSCROLLLINES)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6914
	arg = SPI_GETWHEELSCROLLLINES;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6915
#endif
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6916
#ifdef SPI_GETHOTTRACKING
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6917
    } else if (aNumberOrSymbol == @symbol(SPI_GETHOTTRACKING)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6918
	arg = SPI_GETHOTTRACKING;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6919
	isBool = 1;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6920
#endif
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6921
#ifdef SPI_GETTOOLTIPANIMATION
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6922
    } else if (aNumberOrSymbol == @symbol(SPI_GETTOOLTIPANIMATION)) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6923
	arg = SPI_GETTOOLTIPANIMATION;
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6924
	isBool = 1;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6925
#endif
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6926
#ifdef SPI_GETWORKAREA
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6927
    } else if (aNumberOrSymbol == @symbol(SPI_GETWORKAREA)) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6928
	arg = SPI_GETWORKAREA;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6929
	isRect = 1;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6930
#endif
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6931
#ifdef SPI_GETNONCLIENTMETRICS
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6932
    } else if (aNumberOrSymbol == @symbol(SPI_GETNONCLIENTMETRICS)) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6933
	arg = SPI_GETNONCLIENTMETRICS;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6934
	rslt.nc.cbSize = sizeof ( rslt.nc ) ;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6935
	isNonClientInfo = 1;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6936
#endif
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6937
    } else {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6938
	RETURN (nil);
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6939
    }
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6940
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6941
    param = 0;
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6942
    pRslt = (void *)&rslt;
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6943
    if (isString) {
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6944
	param = sizeof(rslt);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6945
    }
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6946
    retVal = SystemParametersInfo(arg, param, pRslt, 0);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6947
    if (! retVal) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6948
	RETURN (nil);
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6949
    }
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6950
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6951
    if (isBool) {
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
  6952
	RETURN (info ? true : false);
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6953
    }
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6954
    if (isString) {
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6955
	RETURN (__MKSTRING(rslt.buffer));
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6956
    }
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6957
    if (isRect) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6958
	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
  6959
			__MKSMALLINT(rslt.rect.left),
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6960
			__MKSMALLINT(rslt.rect.top),
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6961
			__MKSMALLINT(rslt.rect.right),
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6962
			__MKSMALLINT(rslt.rect.bottom)) );
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6963
    }
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6964
    if (isNonClientInfo) {
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6965
	menuFontInfoArray = __extractLogicalFontParameters(&rslt.nc.lfMenuFont);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6966
	statusFontInfoArray = __extractLogicalFontParameters(&rslt.nc.lfStatusFont);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6967
	messageFontInfoArray = __extractLogicalFontParameters(&rslt.nc.lfMessageFont);
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6968
    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6969
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6970
   out: ;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6971
%}.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6972
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6973
    menuFontInfoArray notNil ifTrue:[
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6974
	menuFont := self fontDescriptionFromLogicalFontInfoArray:menuFontInfoArray.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6975
	statusFont := self fontDescriptionFromLogicalFontInfoArray:statusFontInfoArray.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6976
	messageFont := self fontDescriptionFromLogicalFontInfoArray:messageFontInfoArray.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6977
	^ (Dictionary new)
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6978
	    at:#menuFont put:menuFont;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6979
	    at:#statusFont put:statusFont;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6980
	    at:#messageFont put:messageFont;
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6981
	    yourself.
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6982
    ].
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6983
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6984
    ^ nil
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
  6985
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6986
    "
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6987
     Screen current getSystemParametersInfo:#SPI_GETDESKWALLPAPER
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6988
     Screen current getSystemParametersInfo:#SPI_GETDROPSHADOW
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6989
     Screen current getSystemParametersInfo:#SPI_GETFLATMENU
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6990
     Screen current getSystemParametersInfo:#SPI_GETWHEELSCROLLLINES
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6991
     Screen current getSystemParametersInfo:#SPI_GETHOTTRACKING
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6992
     Screen current getSystemParametersInfo:#SPI_GETTOOLTIPANIMATION
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6993
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6994
     Screen current getSystemParametersInfo:#SPI_GETWORKAREA
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  6995
     Screen current getSystemParametersInfo:#SPI_GETNONCLIENTMETRICS
3721
c3e5152a3b66 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3719
diff changeset
  6996
    "
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6997
!
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  6998
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  6999
ignoreButtonPressOnActivate:aBoolean
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7000
    "set/clear the ignoreButtonPressOnActivate behavior.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7001
     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
  7002
     and not passed to the window.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7003
     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
  7004
     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
  7005
     activation.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7006
     Returns the previous setting."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7007
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7008
%{  /* NOCONTEXT */
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7009
    OBJ rslt = __ignoreButtonPressOnActivate ? true : false;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7010
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7011
    if (aBoolean == true) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7012
       __ignoreButtonPressOnActivate = 1;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7013
    } else {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7014
       if (aBoolean == false) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7015
	   __ignoreButtonPressOnActivate = 0;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7016
       }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7017
    }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7018
    RETURN (rslt);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7019
%}
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7020
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7021
     WinWorkstation ignoreButtonPressOnActivate:true
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7022
     WinWorkstation ignoreButtonPressOnActivate:false
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7023
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7024
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7025
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7026
monitorInfoFor:aMonitorId
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7027
    "given a monitor handle (as returned by monitorHandleForXXX), return its info"
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7028
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7029
    |screenL screenT screenR screenB screenW screenH
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7030
     workL workT workR workB workW workH
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7031
     isPrimary mName|
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7032
%{
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7033
    if (__isExternalAddress(aMonitorId)) {
6067
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
  7034
	HMONITOR hMonitor = (HMONITOR)(_HWNDVal(aMonitorId));
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7035
	MONITORINFOEX info;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7036
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7037
	info.cbSize = sizeof(MONITORINFOEX);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7038
#if 0
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  7039
	/* the following is only needed when we want
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  7040
	 * to support very old NT/W95/W98 systems; we don't !
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
  7041
	 */
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7042
	static BOOL (__stdcall *P_GetMonitorInfo)(HMONITOR , MONITORINFOEX *);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7043
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7044
	if (P_GetMonitorInfo == 0) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7045
	    HINSTANCE hUser = LoadLibrary("user32.dll");
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7046
	    // console_printf("hUser: %x\n", hUser);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7047
	    if (hUser) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7048
		P_GetMonitorInfo = (BOOL (__stdcall *)(HMONITOR, MONITORINFOEX * ))
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7049
				    GetProcAddress(hUser, "GetMonitorInfo");
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7050
	    }
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7051
	}
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
  7052
	DPRINTF(("P_GetMonitorInfo: %x\n", P_GetMonitorInfo));
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7053
	if ((*P_GetMonitorInfo)(hMonitor, &info))
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7054
#else
6067
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
  7055
	if (GetMonitorInfo(hMonitor, (MONITORINFO *)(&info)))
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7056
#endif
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7057
	{
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7058
	    // console_printf("l %d\n", info.rcMonitor.left);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7059
	    screenL = __MKSMALLINT(info.rcMonitor.left);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7060
	    screenT = __MKSMALLINT(info.rcMonitor.top);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7061
	    screenR = __MKSMALLINT(info.rcMonitor.right);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7062
	    screenB = __MKSMALLINT(info.rcMonitor.bottom);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7063
	    workL = __MKSMALLINT(info.rcWork.left);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7064
	    workT = __MKSMALLINT(info.rcWork.top);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7065
	    workR = __MKSMALLINT(info.rcWork.right);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7066
	    workB = __MKSMALLINT(info.rcWork.bottom);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7067
	    isPrimary = (info.dwFlags & MONITORINFOF_PRIMARY) ? true : false;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7068
	    info.szDevice[31] = '\0';
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7069
	    mName = __MKSTRING(info.szDevice);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7070
	}
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7071
    }
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7072
%}.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7073
    screenL isNil ifTrue:[ ^ nil ].
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7074
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7075
    ^ MonitorInfo new
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7076
	screenX:screenL screenY:screenT
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7077
	screenWidth:(screenR-screenL) screenHeight:(screenB-screenT)
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7078
	workX:workL workY:workT
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7079
	workWidth:(workR-workL) workHeight:(workB-workT)
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7080
	isPrimary:isPrimary
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7081
	name:mName
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7082
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7083
    "
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7084
     Screen current monitorInfoFor:(Screen current monitorHandleForView:(Transcript topView id))
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7085
     Screen current monitorInfoFor:(Screen current monitorHandleForPoint:(0@0))
5549
fd4fc69df52d fixed: #monitorHandleForPoint:
Claus Gittinger <cg@exept.de>
parents: 5546
diff changeset
  7086
     Screen current monitorInfoFor:(Screen current monitorHandleForPoint:(Display pointFromUser))
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7087
    "
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7088
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7089
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7090
primGetSystemColor:aKey
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7091
    "retrieve a windows system color.
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7092
     The styleSheet/View classes may use this to setup default colors"
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7093
7305
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
  7094
    |red green blue|
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7095
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7096
%{
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7097
    int p;
7305
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
  7098
    int __bgr;
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7099
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7100
    if (aKey == @symbol(COLOR_WINDOW)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7101
      p = COLOR_WINDOW;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7102
    } else if (aKey == @symbol(COLOR_WINDOWTEXT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7103
      p = COLOR_WINDOWTEXT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7104
    } else if (aKey == @symbol(COLOR_MENU)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7105
      p = COLOR_MENU;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7106
    } else if (aKey == @symbol(COLOR_MENUTEXT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7107
      p = COLOR_MENUTEXT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7108
    } else if (aKey == @symbol(COLOR_BTNFACE)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7109
      p = COLOR_BTNFACE;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7110
    } else if (aKey == @symbol(COLOR_BTNSHADOW)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7111
      p = COLOR_BTNSHADOW;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7112
    } else if (aKey == @symbol(COLOR_BTNTEXT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7113
      p = COLOR_BTNTEXT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7114
    } else if (aKey == @symbol(COLOR_GRAYTEXT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7115
      p = COLOR_GRAYTEXT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7116
    } else if (aKey == @symbol(COLOR_HIGHLIGHT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7117
      p = COLOR_HIGHLIGHT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7118
    } else if (aKey == @symbol(COLOR_HIGHLIGHTTEXT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7119
      p = COLOR_HIGHLIGHTTEXT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7120
    } else if (aKey == @symbol(COLOR_MENU)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7121
      p = COLOR_MENU;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7122
    } else if (aKey == @symbol(COLOR_MENUTEXT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7123
      p = COLOR_MENUTEXT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7124
    } else if (aKey == @symbol(COLOR_SCROLLBAR)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7125
      p = COLOR_SCROLLBAR;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7126
#ifdef COLOR_SHADOW
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7127
    } else if (aKey == @symbol(COLOR_SHADOW)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7128
      p = COLOR_SHADOW;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7129
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7130
#ifdef COLOR_BACKGROUND
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7131
    } else if (aKey == @symbol(COLOR_BACKGROUND)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7132
      p = COLOR_BACKGROUND;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7133
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7134
#ifdef COLOR_ACTIVECAPTION
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7135
    } else if (aKey == @symbol(COLOR_ACTIVECAPTION)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7136
      p = COLOR_ACTIVECAPTION;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7137
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7138
#ifdef COLOR_INACTIVECAPTION
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7139
    } else if (aKey == @symbol(COLOR_INACTIVECAPTION)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7140
      p = COLOR_INACTIVECAPTION;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7141
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7142
#ifdef COLOR_WINDOWFRAME
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7143
    } else if (aKey == @symbol(COLOR_WINDOWFRAME)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7144
      p = COLOR_WINDOWFRAME;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7145
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7146
#ifdef COLOR_CAPTIONTEXT
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7147
    } else if (aKey == @symbol(COLOR_CAPTIONTEXT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7148
      p = COLOR_CAPTIONTEXT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7149
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7150
#ifdef COLOR_ACTIVEBORDER
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7151
    } else if (aKey == @symbol(COLOR_ACTIVEBORDER)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7152
      p = COLOR_ACTIVEBORDER;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7153
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7154
#ifdef COLOR_INACTIVEBORDER
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7155
    } else if (aKey == @symbol(COLOR_INACTIVEBORDER)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7156
      p = COLOR_INACTIVEBORDER;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7157
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7158
#ifdef COLOR_APPWORKSPACE
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7159
    } else if (aKey == @symbol(COLOR_APPWORKSPACE)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7160
      p = COLOR_APPWORKSPACE;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7161
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7162
#ifdef COLOR_INACTIVECAPTIONTEXT
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7163
    } else if (aKey == @symbol(COLOR_INACTIVECAPTIONTEXT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7164
      p = COLOR_INACTIVECAPTIONTEXT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7165
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7166
#ifdef COLOR_BTNHIGHLIGHT
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7167
    } else if (aKey == @symbol(COLOR_BTNHIGHLIGHT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7168
      p = COLOR_BTNHIGHLIGHT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7169
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7170
#ifdef COLOR_3DDKSHADOW
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7171
    } else if (aKey == @symbol(COLOR_3DDKSHADOW)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7172
      p = COLOR_3DDKSHADOW;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7173
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7174
#ifdef COLOR_3DLIGHT
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7175
    } else if (aKey == @symbol(COLOR_3DLIGHT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7176
      p = COLOR_3DLIGHT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7177
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7178
#ifdef COLOR_INFOTEXT
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7179
    } else if (aKey == @symbol(COLOR_INFOTEXT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7180
      p = COLOR_INFOTEXT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7181
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7182
#ifdef COLOR_INFOBK
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7183
    } else if (aKey == @symbol(COLOR_INFOBK)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7184
      p = COLOR_INFOBK;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7185
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7186
#ifdef COLOR_HOTLIGHT
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7187
    } else if (aKey == @symbol(COLOR_HOTLIGHT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7188
      p = COLOR_HOTLIGHT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7189
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7190
#ifdef COLOR_GRADIENTACTIVECAPTION
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7191
    } else if (aKey == @symbol(COLOR_GRADIENTACTIVECAPTION)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7192
      p = COLOR_GRADIENTACTIVECAPTION;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7193
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7194
#ifdef COLOR_GRADIENTINACTIVECAPTION
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7195
    } else if (aKey == @symbol(COLOR_GRADIENTINACTIVECAPTION)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7196
      p = COLOR_GRADIENTINACTIVECAPTION;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7197
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7198
#ifdef COLOR_DESKTOP
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7199
    } else if (aKey == @symbol(COLOR_DESKTOP)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7200
      p = COLOR_DESKTOP;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7201
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7202
#ifdef COLOR_3DFACE
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7203
    } else if (aKey == @symbol(COLOR_3DFACE)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7204
      p = COLOR_3DFACE;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7205
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7206
#ifdef COLOR_3DSHADOW
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7207
    } else if (aKey == @symbol(COLOR_3DSHADOW)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7208
      p = COLOR_3DSHADOW;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7209
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7210
#ifdef COLOR_3DHIGHLIGHT
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7211
    } else if (aKey == @symbol(COLOR_3DHIGHLIGHT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7212
      p = COLOR_3DHIGHLIGHT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7213
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7214
#ifdef COLOR_3DHILIGHT
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7215
    } else if (aKey == @symbol(COLOR_3DHILIGHT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7216
      p = COLOR_3DHILIGHT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7217
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7218
#ifdef COLOR_BTNHILIGHT
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7219
    } else if (aKey == @symbol(COLOR_BTNHILIGHT)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7220
      p = COLOR_BTNHILIGHT;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7221
#endif
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7222
    } else {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7223
      goto getOutOfHere;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7224
    }
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7225
    __bgr = GetSysColor(p);
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7226
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7227
    /* win uses BGR order */
7305
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
  7228
    red = __MKSMALLINT(__bgr & 0xFF);
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
  7229
    green = __MKSMALLINT((__bgr >> 8) & 0xFF);
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
  7230
    blue = __MKSMALLINT((__bgr >> 16) & 0xFF);
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
  7231
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7232
getOutOfHere: ;
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7233
%}.
7305
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
  7234
    red isNil ifTrue:[ ^ nil ].
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7235
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7236
    ^ Color
7452
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
  7237
	redByte:red
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
  7238
	greenByte:green
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
  7239
	blueByte:blue
7305
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
  7240
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
  7241
    "
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
  7242
     Display primGetSystemColor:#COLOR_WINDOW
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
  7243
     Display primGetSystemColor:#COLOR_HIGHLIGHT
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7244
    "
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7245
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7246
    "Modified: / 30-10-2007 / 15:06:02 / cg"
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7247
!
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
  7248
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7249
primViewIdFromPoint:aPoint in:windowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7250
    "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
  7251
     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
  7252
     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
  7253
     - 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
  7254
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7255
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7256
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7257
    OBJ xp, yp;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7258
    int xpos, ypos;
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  7259
    HWND child_ret;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7260
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7261
    if (ISCONNECTED
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7262
     && __isExternalAddress(windowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7263
     && __isPoint(aPoint))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7264
    {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7265
	xp = _point_X(aPoint);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7266
	yp = _point_Y(aPoint);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7267
	if (__bothSmallInteger(xp, yp))
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7268
	{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7269
	    POINT p;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7270
	    HWND hWnd = _HWNDVal(windowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7271
	    p.x = __intVal(xp);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7272
	    p.y = __intVal(yp);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7273
	    ScreenToClient(hWnd, &p);
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  7274
	    child_ret = ChildWindowFromPointEx(hWnd,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  7275
	    /*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
  7276
	    if ((child_ret) && (child_ret != hWnd))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7277
	    {
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  7278
		RETURN ( __MKEXTERNALADDRESS(child_ret) );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7279
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7280
	    RETURN ( nil );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7281
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7282
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7283
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7284
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7285
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7286
prim_getWindowRect:hWnd
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7287
    |l r t b|
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7288
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7289
%{
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7290
    if (__isExternalAddress(hWnd) || __isExternalBytesLike(hWnd)) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7291
	HANDLE _hwnd = __externalAddressVal(hWnd);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7292
	RECT rect;
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7293
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7294
	if (GetWindowRect(_hwnd, &rect)) {
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7295
	    l = __MKSMALLINT(rect.left);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7296
	    r = __MKSMALLINT(rect.right);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7297
	    t = __MKSMALLINT(rect.top);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7298
	    b = __MKSMALLINT(rect.bottom);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7299
	}
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7300
    }
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7301
%}.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7302
    l isNil ifTrue:[
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
  7303
	self primitiveFailed.
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7304
    ].
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7305
    ^ l@t corner:r@b
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7306
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
  7307
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7308
protocolVersion
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7309
    "return the displays protocol version.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7310
     For Windows, a dummy number is returned"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7311
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7312
    ^ '1'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7313
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7314
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7315
     Display protocolVersion
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7316
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7317
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7318
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7319
rightButtonIsLowerWindow:aBoolean
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7320
    "set/clear the rightButtonIsLowerWindow behavior.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7321
     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
  7322
     window.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7323
     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
  7324
     and not provided by the standard windows applications.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7325
     Returns the previous setting."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7326
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7327
%{  /* NOCONTEXT */
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7328
    OBJ rslt = __rightButtonIsLowerWindow ? true : false;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7329
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7330
    if (aBoolean == true) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7331
       __rightButtonIsLowerWindow = 1;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7332
    } else {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7333
       if (aBoolean == false) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7334
	   __rightButtonIsLowerWindow = 0;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7335
       }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7336
    }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7337
    RETURN (rslt);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7338
%}
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7339
    "
5440
9f158dcd32e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5372
diff changeset
  7340
     Display rightButtonIsLowerWindow:true
9f158dcd32e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5372
diff changeset
  7341
     Display rightButtonIsLowerWindow:false
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7342
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7343
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7344
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7345
serverVendor
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7346
    "return the server vendor string.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7347
     For Windows, a dummy name is returned"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7348
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7349
    ^ 'microsoft'
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7350
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
     Display serverVendor
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7353
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7354
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7355
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7356
shiftMask
3261
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7357
    "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
  7358
     Obsolete"
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7359
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7360
%{  /* NOCONTEXT */
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7361
    RETURN (__MKSMALLINT(ShiftMask));
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7362
%}
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7363
!
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7364
91ca42a43c77 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3161
diff changeset
  7365
shiftModifierMask
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7366
    "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
  7367
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7368
%{  /* NOCONTEXT */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7369
    RETURN (__MKSMALLINT(ShiftMask));
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7370
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7371
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7372
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7373
shiftedLeftButtonIsLowerWindow:aBoolean
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7374
    "set/clear the shiftedLeftButtonIsLowerWindow behavior.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7375
     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
  7376
     window.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7377
     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
  7378
     and not provided by the standard windows applications.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7379
     Notice, this duplicates the rightButtonIsLowerWindow behavior,
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7380
     but is useful with single-button mice.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7381
     Returns the previous setting."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7382
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7383
%{  /* NOCONTEXT */
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7384
    OBJ rslt = __shiftedLeftButtonIsLowerWindow ? true : false;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7385
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7386
    if (aBoolean == true) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7387
       __shiftedLeftButtonIsLowerWindow = 1;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7388
    } else {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7389
       if (aBoolean == false) {
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7390
	   __shiftedLeftButtonIsLowerWindow = 0;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7391
       }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7392
    }
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7393
    RETURN (rslt);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7394
%}
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7395
    "
5440
9f158dcd32e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5372
diff changeset
  7396
     Display shiftedLeftButtonIsLowerWindow:true
9f158dcd32e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5372
diff changeset
  7397
     Display shiftedLeftButtonIsLowerWindow:false
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7398
    "
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7399
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
  7400
2682
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7401
supportedSystemColorKeys
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7402
    "return a collection of supported systemColor keys"
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7403
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7404
    ^#(
2682
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7405
	COLOR_WINDOW
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7406
	COLOR_WINDOWTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7407
	COLOR_MENU
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7408
	COLOR_MENUTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7409
	COLOR_BTNFACE
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7410
	COLOR_BTNSHADOW
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7411
	COLOR_BTNTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7412
	COLOR_GRAYTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7413
	COLOR_HIGHLIGHT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7414
	COLOR_HIGHLIGHTTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7415
	COLOR_MENU
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7416
	COLOR_MENUTEXT
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7417
	COLOR_SCROLLBAR
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7418
	COLOR_SHADOW
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7419
    )
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7420
!
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
  7421
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7422
translatePoint:aPoint from:windowId1 to:windowId2
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7423
    "given a point in window1, return the coordinate in window2.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7424
     This expects a device coordinate (relative to the first views origin)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7425
     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
  7426
     - use to xlate points from a window to rootwindow"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7427
6004
7f78335fa58a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6003
diff changeset
  7428
    |x1 y1 x2 y2 ret|
2276
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7429
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7430
    x1 := x2 := aPoint x truncated.
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7431
    y1 := y2 := aPoint y truncated.
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7432
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7433
%{
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7434
    HWND w1, w2;
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7435
    POINT point;
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7436
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7437
    if (__isExternalAddress(windowId1)
98198d9748e6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2270
diff changeset
  7438
     && __isExternalAddress(windowId2)
2279
30a35be06995 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2276
diff changeset
  7439
     && __bothSmallInteger(x1, y1)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  7440
	w1 = _HWNDVal(windowId1);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  7441
	w2 = _HWNDVal(windowId2);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  7442
	point.x = __intVal(x1);
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  7443
	point.y = __intVal(y1);
6004
7f78335fa58a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6003
diff changeset
  7444
	CPRINTF(("TransPoint %x %d/%d ->", w1, point.x, point.y));
7f78335fa58a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6003
diff changeset
  7445
	if (ClientToScreen(w1, &point) == FALSE) {
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7446
	    RETURN (nil);
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7447
	}
6004
7f78335fa58a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6003
diff changeset
  7448
	if (ScreenToClient(w2, &point) == FALSE) {
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7449
	    RETURN (nil);
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  7450
	}
6004
7f78335fa58a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6003
diff changeset
  7451
	CPRINTF((" %x %d/%d\n", w2, point.x, point.y));
7f78335fa58a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6003
diff changeset
  7452
	ret = __MKPOINT_INT(point.x, point.y);
7f78335fa58a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6003
diff changeset
  7453
    }
7f78335fa58a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6003
diff changeset
  7454
%}.
7f78335fa58a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6003
diff changeset
  7455
    ^ ret
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7456
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7457
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7458
vendorRelease
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7459
    "return the display-servers vendor release
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7460
     - should normally not be of any interest,
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7461
     but may be usefule for special cases.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7462
     (to avoid bugs in certain implementations / releases)"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7463
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7464
    ^ 1
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7465
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7466
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7467
     Display vendorRelease
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7468
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7469
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7470
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7471
viewIdFromPoint:aPoint in:windowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7472
    "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
  7473
     hit by this coordinate. Return nil if no view was hit.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7474
     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
  7475
     - 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
  7476
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7477
    windowId notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7478
	aPoint isPoint ifTrue:[
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7479
	    "/(aPoint x > 30000) ifTrue:[self halt.].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7480
	    "/(aPoint y > 30000) ifTrue:[self halt.].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7481
	    "/aPoint printString errorPrintCR.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7482
	    ^ self primViewIdFromPoint:aPoint asPoint truncated in:windowId
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7483
	]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7484
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7485
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7486
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7487
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7488
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7489
whitepixel
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7490
    "return the colornumber of white"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7491
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7492
    ^ whitepixel
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7493
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7494
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7495
!WinWorkstation methodsFor:'accessing display capabilities'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7496
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7497
captionHeight
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7498
    "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
  7499
     standard topWindows."
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7500
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7501
    ^ self getSystemMetrics:#SM_CYCAPTION
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7502
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7503
    "Modified: / 08-09-2006 / 15:39:24 / cg"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7504
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7505
5672
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  7506
getDeviceCaps:hdc index:index
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  7507
    <apicall: int "GetDeviceCaps" (handle int) module: "gdi32.dll" >
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  7508
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  7509
    "Created: / 24-12-2010 / 11:14:59 / cg"
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  7510
!
Claus Gittinger <cg@exept.de>
parents: 5671
diff changeset
  7511
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7512
iconSizes
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7513
    "Get the preferred/supported icon sizes."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7514
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7515
    |d w h|
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7516
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7517
    w := self getSystemMetrics:#SM_CXICON.
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7518
    h := self getSystemMetrics:#SM_CYICON.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7519
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7520
    d := IdentityDictionary new.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7521
    d at:#minWidth put:w.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7522
    d at:#maxWidth put:h.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7523
    d at:#widthStep put:1.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7524
    d at:#minHeight put:w.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7525
    d at:#maxHeight put:h.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7526
    d at:#heightStep put:1.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7527
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7528
    ^ OrderedCollection with:d
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7529
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7530
    "
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7531
     Display iconSizes
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7532
    "
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7533
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7534
    "Modified: / 08-09-2006 / 15:40:18 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7535
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7536
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7537
monitorBoundsAt:aPoint
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7538
    "answer the bounds of the monitor the point is contained in"
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7539
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7540
    |monitorHandle monitorInfo|
5607
Michael Beyl <mb@exept.de>
parents: 5600
diff changeset
  7541
Michael Beyl <mb@exept.de>
parents: 5600
diff changeset
  7542
    self numberOfMonitors > 1 ifTrue:[
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
  7543
	"/ ******* MULTI SCREEN ******
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
  7544
	monitorHandle := self monitorHandleForPoint:aPoint.
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
  7545
	monitorHandle notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
  7546
	    monitorInfo := self monitorInfoFor:monitorHandle.
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
  7547
	    monitorInfo notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
  7548
		^ monitorInfo bounds
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
  7549
	    ].
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
  7550
	].
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7551
    ].
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7552
    ^ super monitorBoundsAt:aPoint
5621
d525c04c0390 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 5618
diff changeset
  7553
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7554
    "
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7555
     Display monitorBoundsAt:100@100
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7556
     Display monitorBoundsAt:2000@100
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7557
     Display monitorBoundsAt:-200@100
5607
Michael Beyl <mb@exept.de>
parents: 5600
diff changeset
  7558
    "
5621
d525c04c0390 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 5618
diff changeset
  7559
d525c04c0390 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 5618
diff changeset
  7560
    "Modified: / 22-10-2010 / 10:55:59 / cg"
5607
Michael Beyl <mb@exept.de>
parents: 5600
diff changeset
  7561
!
Michael Beyl <mb@exept.de>
parents: 5600
diff changeset
  7562
5552
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7563
numberOfMonitors
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7564
    ^ self getSystemMetrics:#SM_CMONITORS
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7565
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7566
    "
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7567
     Display numberOfMonitors
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7568
    "
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7569
!
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7570
5640
2116555f5672 added: #pointIsVisible:
Stefan Vogel <sv@exept.de>
parents: 5637
diff changeset
  7571
pointIsVisible:aPoint
2116555f5672 added: #pointIsVisible:
Stefan Vogel <sv@exept.de>
parents: 5637
diff changeset
  7572
    "is the point visible?"
2116555f5672 added: #pointIsVisible:
Stefan Vogel <sv@exept.de>
parents: 5637
diff changeset
  7573
2116555f5672 added: #pointIsVisible:
Stefan Vogel <sv@exept.de>
parents: 5637
diff changeset
  7574
    ^ (self monitorHandleForPoint:aPoint) notNil
2116555f5672 added: #pointIsVisible:
Stefan Vogel <sv@exept.de>
parents: 5637
diff changeset
  7575
!
2116555f5672 added: #pointIsVisible:
Stefan Vogel <sv@exept.de>
parents: 5637
diff changeset
  7576
5637
460a01c483d2 added: #pointsAreOnSameMonitor:and:
Stefan Vogel <sv@exept.de>
parents: 5630
diff changeset
  7577
pointsAreOnSameMonitor:point1 and:point2
460a01c483d2 added: #pointsAreOnSameMonitor:and:
Stefan Vogel <sv@exept.de>
parents: 5630
diff changeset
  7578
    "are the two points on the same (multi-screen) monitors?"
460a01c483d2 added: #pointsAreOnSameMonitor:and:
Stefan Vogel <sv@exept.de>
parents: 5630
diff changeset
  7579
460a01c483d2 added: #pointsAreOnSameMonitor:and:
Stefan Vogel <sv@exept.de>
parents: 5630
diff changeset
  7580
    ^ (self monitorHandleForPoint:point1) = (self monitorHandleForPoint:point2)
460a01c483d2 added: #pointsAreOnSameMonitor:and:
Stefan Vogel <sv@exept.de>
parents: 5630
diff changeset
  7581
!
460a01c483d2 added: #pointsAreOnSameMonitor:and:
Stefan Vogel <sv@exept.de>
parents: 5630
diff changeset
  7582
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7583
preferredIconSize
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7584
    "Get the preferrered icon size.
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7585
     Here, workaround windows (bug?) which returns 32@32
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7586
     although, 20@20 is much nicer"
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7587
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7588
    ^ 20@20
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7589
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7590
    "
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7591
     Display preferredIconSize
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7592
    "
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7593
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7594
    "Modified: / 28.9.1998 / 13:49:54 / cg"
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7595
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
  7596
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7597
scrollsAsynchronous
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7598
    "return true, if this display asynchronously sends expose events after a
6028
7a9807630f4f class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  7599
     scroll operation. False otherwise. Asynchronous expose events are an X11
6020
24d09f0c1e6c class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6008
diff changeset
  7600
     speciality, which affects a few methods outside of the display class (sorry)
6028
7a9807630f4f class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  7601
     However, the underlying WinWorkstation code simulates this behavior,
7a9807630f4f class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  7602
     so we return true here as well."
7a9807630f4f class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  7603
7a9807630f4f class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  7604
    ^ true.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7605
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7606
5866
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7607
smallestMonitorHeight
5867
f6b5ce37a2a5 comment/format in: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5866
diff changeset
  7608
    "returns the usable height of the smallest monitor in a mult-monitor setup"
5866
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7609
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7610
    |info minH|
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7611
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7612
    minH := self usableHeight.
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7613
    self monitorHandles do:[:eachHandle |
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
  7614
	info := self monitorInfoFor:eachHandle.
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
  7615
	info notNil ifTrue:[ minH := minH min: info workHeight ].
5866
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7616
    ].
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7617
    ^ minH
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7618
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7619
    "
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7620
     Display smallestMonitorHeight
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7621
    "
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7622
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7623
    "Modified: / 22-10-2010 / 15:34:44 / cg"
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7624
!
f260682ba785 added: #smallestMonitorHeight
Stefan Vogel <sv@exept.de>
parents: 5847
diff changeset
  7625
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7626
supportedImageFormats
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7627
    "return an array with supported image formats; each array entry
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7628
     is another array, consisting of depth and bitsPerPixel values."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7629
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7630
    |info|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7631
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7632
    info := IdentityDictionary new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7633
    info at:#depth put:depth.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7634
    info at:#bitsPerPixel put:depth.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7635
    info at:#padding put:32.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7636
    ^ Array with:info
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7637
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7638
    "
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7639
     Disply supportedImageFormats
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7640
    "
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7641
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
  7642
    "Modified: / 10.9.1998 / 23:14:05 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7643
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7644
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7645
supportsDeepIcons
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7646
    "return true, if this device supports deepicons."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7647
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7648
    ^ true
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7649
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7650
2604
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7651
supportsIconMasks
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7652
    "return true, if this device supports masked icons.
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7653
     For now, return false since somehow icons are inverted
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7654
     if we use masks (and I dont know yet why)."
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7655
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7656
    ^ false
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7657
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7658
    "
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7659
     Display supportsIconMasks
2604
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7660
    "
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7661
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7662
    "Modified: / 28.4.1999 / 19:59:17 / cg"
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7663
!
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
  7664
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7665
supportsIconViews
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7666
    "return true, if this device supports views as icons."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7667
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  7668
    ^ false "/ true
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7669
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7670
    "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7671
     Display supportsIconViews
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7672
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7673
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7674
    "Modified: 10.6.1996 / 20:11:48 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7675
    "Created: 10.6.1996 / 21:08:18 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7676
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7677
2632
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  7678
supportsMaskedDrawingWith:aForm
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  7679
    "return true, if the device allows the given form pixmap
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  7680
     to be used as paint color."
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  7681
7472
2af1c55ce4b6 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7452
diff changeset
  7682
    ^ self supportsAnyViewBackgroundPixmaps
2632
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  7683
e18b55db3e1e replaced supportdMaskedDrawing by a method which gets the
Claus Gittinger <cg@exept.de>
parents: 2630
diff changeset
  7684
    "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
  7685
    "Modified: / 4.5.1999 / 12:58:31 / cg"
2339
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  7686
!
9777d3509d1f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2338
diff changeset
  7687
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7688
supportsViewBackgroundPixmap:aForm
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7689
    "return true, if the device allows the given pixmap as
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7690
     viewBackground. If false is returned,
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  7691
     drawing is done by (possibly) slower smalltalk code."
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  7692
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
  7693
    ^ true
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7694
!
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7695
2908
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7696
supportsWindowBorder:aNumber
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7697
    "return true, if this device supports bordered windows.
3109
f29d9b8a978d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3080
diff changeset
  7698
     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
  7699
     to be supported by the device.
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7700
     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
  7701
     future. (Windows only supports borders 1 and noBorder)"
f29d9b8a978d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3080
diff changeset
  7702
f29d9b8a978d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3080
diff changeset
  7703
    ^ (aNumber ? 0) <= 1
2908
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7704
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7705
    "
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7706
     Display supportsWindowBorder:1
2908
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7707
    "
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7708
!
662656ca3794 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2817
diff changeset
  7709
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7710
usableExtent
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7711
    "return the usable extent of the display (in pixels).
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7712
     Normally, the same as extent, but may be smaller, in
5553
5d324e95ec8d comment/format in: #usableExtent
Claus Gittinger <cg@exept.de>
parents: 5552
diff changeset
  7713
     case some menu space is taken up by the window manager (windows),
5d324e95ec8d comment/format in: #usableExtent
Claus Gittinger <cg@exept.de>
parents: 5552
diff changeset
  7714
     or bigger, in case of multi-screen systems"
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7715
4576
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7716
    |wSingle hSingle w h dx dy|
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7717
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7718
    w := wSingle := self getSystemMetrics:#SM_CXFULLSCREEN.
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7719
    h := hSingle := self getSystemMetrics:#SM_CYFULLSCREEN.
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7720
5552
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7721
    (self numberOfMonitors) > 1 ifTrue:[
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7722
	w := self getSystemMetrics:#SM_CXVIRTUALSCREEN.
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7723
	h := self getSystemMetrics:#SM_CYVIRTUALSCREEN.
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7724
	(w isNil or:[h isNil]) ifTrue:[
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7725
	    "/ not supported under win95 and win-nt4 - fallback to real extent
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7726
	    w := wSingle.
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7727
	    h := hSingle.
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7728
	] ifFalse:[
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7729
	    dx := (self getSystemMetrics:#SM_CXSCREEN) - wSingle.
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7730
	    dy := (self getSystemMetrics:#SM_CYSCREEN) - hSingle.
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7731
	    w := w - dx.
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7732
	    h := h - dy - 8.
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7733
	].
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7734
    ].
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7735
    ^ w @ h.
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7736
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  7737
    "
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7738
     Display usableExtent
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7739
     Display getSystemMetrics:#SM_CYVIRTUALSCREEN
4576
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7740
     Display getSystemMetrics:#SM_CYFULLSCREEN
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7741
     Display getSystemMetrics:#SM_CYSCREEN
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7742
     Display getSystemMetrics:#SM_CMONITORS
4576
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7743
    "
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7744
04bf0d3a0ddd usableExtent - care for menu bar (if any)
Claus Gittinger <cg@exept.de>
parents: 4575
diff changeset
  7745
    "Modified: / 08-09-2006 / 18:19:22 / cg"
5552
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7746
!
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7747
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7748
usableHeightAt:aPoint
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7749
    "returns the usable height of the display (in pixels) at a given point
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7750
     Normally, the same as height, but may be smaller, in
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7751
     case some menu space is taken up by the window manager (windows).
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  7752
     On multi-display systems with different sized screens, this should care for
5552
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7753
     which display is at the given x-position"
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7754
5943
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7755
    |info fullHeight usableHeight delta|
5552
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7756
5630
a690d4635014 changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5621
diff changeset
  7757
    true "(self numberOfMonitors) > 1" ifTrue:[
6601
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
  7758
	"/ ******* MULTI SCREEN ******
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
  7759
	info := self monitorInfoFor:(self monitorHandleForPoint:aPoint).
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
  7760
	info notNil ifTrue:[
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
  7761
	    ^ info workHeight
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
  7762
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
  7763
	"/ only works with single screen..
6565
a3955bc42356 class: WinWorkstation
ca
parents: 6494
diff changeset
  7764
"/            fullHeight := self getSystemMetrics:#SM_CYVIRTUALSCREEN.
a3955bc42356 class: WinWorkstation
ca
parents: 6494
diff changeset
  7765
"/            usableHeight := self getSystemMetrics:#SM_CYFULLSCREEN.  "/ without any start-menu bar
a3955bc42356 class: WinWorkstation
ca
parents: 6494
diff changeset
  7766
"/            delta := fullHeight - usableHeight.
a3955bc42356 class: WinWorkstation
ca
parents: 6494
diff changeset
  7767
"/            ^ info workHeight - delta
6601
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
  7768
	].
5552
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7769
    ].
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7770
    ^ self usableHeight
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7771
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7772
    "
5943
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7773
     Display numberOfMonitors
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7774
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7775
     Display usableHeight
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7776
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  7777
     Display usableHeightAt:100@100
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  7778
     Display usableHeightAt:2000@100
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  7779
     Display usableHeightAt:-200@100
5552
Claus Gittinger <cg@exept.de>
parents: 5549
diff changeset
  7780
    "
5621
d525c04c0390 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 5618
diff changeset
  7781
5943
55021742c5fd changed: #usableHeightAt:
Claus Gittinger <cg@exept.de>
parents: 5941
diff changeset
  7782
    "Modified (comment): / 27-10-2012 / 13:34:32 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7783
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7784
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7785
!WinWorkstation methodsFor:'bitmap/window creation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7786
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7787
addMenuItemWithLabel:aString toWindowID:aWindowId
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7788
    "not yet"
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7789
%{
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7790
#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
  7791
    if (__isExternalAddress(aWindowId)) {
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7792
	HWND hWin = _HWNDVal(aWindowId);
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7793
	HMENU hMenu;
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7794
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7795
	hMenu = GetMenu(hWin);
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7796
	if (hMenu) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7797
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7798
	}
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7799
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7800
#endif
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7801
%}
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7802
!
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
  7803
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7804
createBitmapFromArray:anArray width:w height:h
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7805
    |bitmapId|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7806
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7807
    bitmapId := self primCreateBitmapFromArray:anArray width:w height:h.
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7808
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7809
    bitmapId isNil ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7810
	'WINWORKSTATION: cannot create bitmap' errorPrintCR.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7811
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7812
    ^ bitmapId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7813
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7814
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7815
createBitmapWidth:w height:h
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7816
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7817
%{
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7818
    HANDLE newBitmapHandle;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7819
    int b_width, b_height;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7820
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7821
    if (__bothSmallInteger(w, h)) {
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7822
	b_width = __intVal(w);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7823
	b_height = __intVal(h);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7824
	newBitmapHandle = CreateBitmap(b_width, b_height, 1, 1, NULL);
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7825
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  7826
	if (newBitmapHandle) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7827
#ifdef COUNT_BMP_RESOURCES
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7828
	    __cnt_bitmap++;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7829
	    RES_BMP_PRINTF(("CreateBitmap %x %d\n",newBitmapHandle, __cnt_bitmap));
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7830
#endif
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7831
	    RETURN ( __MKOBJ(newBitmapHandle));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7832
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7833
	DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7834
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7835
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7836
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7837
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7838
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7839
createPixmapWidth:w height:h depth:d
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7840
    "allocate a pixmap on the Xserver, the contents is undefined
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7841
     (i.e. random). Return a bitmap id or nil"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7842
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  7843
%{
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7844
    HANDLE newBitmapHandle;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7845
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  7846
    /*console_printf("CreateBitmap Color\n");*/
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7847
    if (__bothSmallInteger(w, h) && __isSmallInteger(d) && ISCONNECTED) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7848
	if (__intVal(d) == 1) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7849
	    newBitmapHandle = CreateBitmap(__intVal(w), __intVal(h) , 1, 1, NULL);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7850
	} else {
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
  7851
#if 0
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7852
	    if (__intVal(d) != __depth) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  7853
		console_printf("invalid depth\n");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7854
		RETURN (nil);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  7855
	    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7856
#endif
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7857
	    newBitmapHandle = CreateCompatibleBitmap(__rootDC, __intVal(w), __intVal(h) );
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7858
	}
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7859
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7860
	if (newBitmapHandle) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7861
#ifdef COUNT_BMP_RESOURCES
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  7862
	    __cnt_bitmap++;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  7863
	    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
  7864
#endif
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  7865
	    RETURN ( __MKOBJ(newBitmapHandle));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7866
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7867
	DPRINTF(("empty bitmap handle = %x\n", newBitmapHandle));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7868
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7869
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7870
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7871
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7872
1467
9629ce710c53 added type argument to createWindowFor - prepare for native window support (windows)
Claus Gittinger <cg@exept.de>
parents: 1461
diff changeset
  7873
createWindowFor:aView type:typeSymbol
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7874
		 origin:origin
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7875
		 extent:extent
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7876
		 minExtent:minExt
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7877
		 maxExtent:maxExt
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7878
		 borderWidth:bWidth
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7879
		 subViewOf:wsuperView
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7880
		 style:wStyle
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7881
		 inputOnly:winputOnly
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7882
		 label:wlabel
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7883
		 owner:wowner
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7884
		 icon:wicon
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7885
		 iconMask:wiconMaskArg
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7886
		 iconView:wiconView
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7887
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7888
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7889
    |xpos ypos wwidth wheight minWidth minHeight maxWidth maxHeight
4326
2c828f8b5173 fixed iconMask
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  7890
     wsuperViewId wiconId wiconMask invertedWiconMask wiconMaskId windowId
2c828f8b5173 fixed iconMask
Claus Gittinger <cg@exept.de>
parents: 4284
diff changeset
  7891
     weventMask wiconWidth wiconHeight windowType windowClass moreArgs|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7892
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7893
    "/ bColorId wiconViewId bitGravity vBgColor vBgForm deepForm
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7894
    "/  preferredVisual preferredDepth  viewGravity wcursorId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7895
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7896
    displayId isNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7897
	self primitiveFailed.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7898
	^ nil
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7899
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7900
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7901
    origin notNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7902
	xpos := origin x.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7903
	ypos := origin y.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7904
    ] ifFalse:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7905
	xpos := ypos := 0.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7906
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7907
    extent notNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7908
	wwidth := extent x.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7909
	wheight := extent y.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7910
    ] ifFalse:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7911
	wwidth := 100.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7912
	wheight := 40.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7913
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7914
    minExt notNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7915
	minWidth := minExt x.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7916
	minHeight := minExt y
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7917
    ] ifFalse:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7918
	minWidth := 1.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7919
	minHeight := 1.
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7920
    ].
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7921
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7922
    maxExt notNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7923
	maxWidth := maxExt x.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7924
	maxHeight := maxExt y
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  7925
    ] ifFalse:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7926
	"/ this is not really a good idea
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7927
	"/ maxWidth := width.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7928
	"/ maxHeight := height.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7929
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7930
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7931
    wsuperView notNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7932
	wsuperViewId := wsuperView id
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7933
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7934
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7935
    wicon notNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7936
	wiconId := wicon id.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7937
	wiconHeight := wicon height.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7938
	wiconWidth  := wicon width.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7939
	wiconMask := wiconMaskArg.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7940
	wiconMask isNil ifTrue:[
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7941
	    wiconMask := wicon mask.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7942
	].
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7943
	wiconMask notNil ifTrue:[
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7944
	    "/ WIN32's mask has zeros for opaque pixels
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7945
	    invertedWiconMask := wiconMask copy.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7946
	    invertedWiconMask bits invert.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7947
	    invertedWiconMask := invertedWiconMask onDevice:self.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7948
	    wiconMaskId := invertedWiconMask id
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7949
	].
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7950
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7951
"/    wiconView notNil ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7952
"/        wiconViewId := wiconView id
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7953
"/    ].
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7954
    weventMask := aView eventMask.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  7955
4261
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
  7956
    NativeWidgets ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7957
	windowType := aView nativeWindowType.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7958
	windowType notNil ifTrue:[
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7959
	    "/ must be a symbol and is used
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7960
	    "/ as a key into the nativeClass translation map.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7961
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7962
	    windowClass := NativeWidgetClassTable at:windowType ifAbsent:windowType.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7963
	    self class debugNative ifTrue:[
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7964
		'WinWorkstation [info]: windowType: ' infoPrint. windowType infoPrint.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7965
		' windowClass: ' infoPrint. windowClass infoPrintCR.
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7966
	    ].
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7967
	].
4262
129e10b82f57 *** empty log message ***
ca
parents: 4261
diff changeset
  7968
    ].
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  7969
    aView isMDIClientView ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7970
	windowClass := 'mdiclient'.
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  7971
    ].
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  7972
4262
129e10b82f57 *** empty log message ***
ca
parents: 4261
diff changeset
  7973
    windowClass notNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7974
	aView beNativeWidget.
4262
129e10b82f57 *** empty log message ***
ca
parents: 4261
diff changeset
  7975
    ] ifFalse:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  7976
	aView beNonNativeWidget.
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  7977
    ].
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  7978
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7979
    moreArgs := Array new:20.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7980
    moreArgs at:1 put:xpos.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7981
    moreArgs at:2 put:ypos.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7982
    moreArgs at:3 put:wwidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7983
    moreArgs at:4 put:wheight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7984
    moreArgs at:5 put:minWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7985
    moreArgs at:6 put:minHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7986
    moreArgs at:7 put:maxWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7987
    moreArgs at:8 put:maxHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7988
    moreArgs at:9 put:wsuperViewId.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7989
    moreArgs at:10 put:nil. "/ wcursorId.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7990
    moreArgs at:11 put:wiconId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7991
    moreArgs at:12 put:wiconMaskId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7992
    moreArgs at:13 put:wiconWidth.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7993
    moreArgs at:14 put:wiconHeight.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7994
    moreArgs at:15 put:windowType.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  7995
    moreArgs at:16 put:windowClass.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7996
    moreArgs at:17 put:weventMask.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  7997
    moreArgs at:18 put:(aView className asString).
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7998
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  7999
    [
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8000
      windowId := self
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8001
		  primCreateWindowFor:aView
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8002
		  type:typeSymbol
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8003
		  borderWidth:bWidth
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8004
		  subViewOf:wsuperView
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8005
		  style:wStyle
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8006
		  inputOnly:winputOnly
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8007
		  label:wlabel
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8008
		  owner:wowner
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8009
		  icon:wicon
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8010
		  iconMask:wiconMask
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8011
		  moreArgs:moreArgs.
7452
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
  8012
      aView graphicsContext setId:windowId.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8013
    ] valueUninterruptably.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8014
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  8015
    windowId notNil ifTrue:[
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8016
	self addKnownView:aView withId:windowId
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  8017
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8018
    ^ windowId
5842
53c51d88ccac changed: #createWindowFor:type:origin:extent:minExtent:maxExtent:borderWidth:subViewOf:style:inputOnly:label:owner:icon:iconMask:iconView:
Claus Gittinger <cg@exept.de>
parents: 5835
diff changeset
  8019
53c51d88ccac changed: #createWindowFor:type:origin:extent:minExtent:maxExtent:borderWidth:subViewOf:style:inputOnly:label:owner:icon:iconMask:iconView:
Claus Gittinger <cg@exept.de>
parents: 5835
diff changeset
  8020
    "Modified: / 28-01-2012 / 10:20:30 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8021
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8022
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8023
destroyGC:aGCId
4478
fb57ec7d7cc4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4476
diff changeset
  8024
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8025
    if (__isExternalAddress(aGCId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8026
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8027
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8028
	if (gcData == NULL) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8029
	    console_fprintf(stderr, "WinWorkstation [warning]: trying to destroy GC twice\n");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8030
	    RETURN(self);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8031
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8032
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8033
#ifdef COUNT_RESOURCES
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8034
	 __cnt_gcData--;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8035
	RESPRINTF(("DestroyGcData %d\n",__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8036
#endif
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8037
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8038
#ifdef CACHE_LAST_DC
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8039
	if (lastGcData == gcData) {
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  8040
	    _releaseDC(gcData);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8041
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8042
#endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8043
	__ExternalAddressInstPtr(aGCId)->e_address = NULL;
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  8044
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
  8045
	freeGcData(gcData);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8046
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8047
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8048
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8049
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8050
destroyPixmap:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8051
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8052
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8053
    if (__isExternalAddress(aDrawableId) && ISCONNECTED) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8054
	HANDLE bitmapHandle = _HANDLEVal(aDrawableId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8055
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  8056
	if (bitmapHandle) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8057
#ifdef COUNT_BMP_RESOURCES
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8058
	    __cnt_bitmap--;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8059
	    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
  8060
#endif
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  8061
	    _DeleteObject(bitmapHandle, __LINE__);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8062
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8063
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8064
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8065
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8066
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8067
destroyView:aView withId:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8068
    self primDestroyView:aView withId:aWindowId.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8069
    self removeKnownView:aView withId:aWindowId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8070
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8071
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8072
gcFor:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8073
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8074
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8075
    HWND hWnd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8076
    struct gcData *gcData;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8077
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8078
    if (__isExternalAddress(aDrawableId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8079
	hWnd = _HWNDVal(aDrawableId);
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8080
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8081
	if (! hWnd) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8082
	    RETURN (nil);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8083
	}
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8084
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8085
	gcData = newGcData();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8086
	if (! gcData) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8087
	    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8088
	}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8089
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8090
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8091
	__cnt_gcData++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8092
	RESPRINTF(("CreateGcData %d\n",__cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8093
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8094
	gcData->hWnd = hWnd;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8095
	gcData->_hDC = 0;
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  8096
	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
  8097
	RETURN ( __MKOBJ(gcData) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8098
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8099
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8100
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8101
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8102
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8103
gcForBitmap:aDrawableId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8104
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8105
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8106
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8107
    if (__isExternalAddress(aDrawableId)) {  /* HBITMAP */
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8108
	struct gcData *gcData;
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8109
	BITMAP bitmap;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8110
	HBITMAP hBitmap = _HBITMAPVAL(aDrawableId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8111
	HDC hDC;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8112
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8113
	if (! hBitmap) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8114
	    RETURN (nil);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8115
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8116
	gcData = newGcData();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8117
	if (! gcData) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8118
	    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8119
	}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
  8120
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8121
	if (GetObject(hBitmap, sizeof(bitmap), &bitmap)) {
6165
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  8122
	    DDDDPRINTF(("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
  8123
	} else {
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  8124
	    DPRINTF(("noinfo returned for bitmap\n"));
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8125
	    /* mhmh - can this happen ? */
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8126
	    bitmap.bmBitsPixel = 1;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8127
	}
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8128
	gcData->hBitmap = hBitmap;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8129
	gcData->bitmapColorBitCount = bitmap.bmBitsPixel;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8130
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8131
#ifdef COUNT_RESOURCES
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8132
	__cnt_gcData++;
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
  8133
	RESPRINTF(("CreateGcData %d\n", __cnt_gcData));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8134
#endif
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8135
	RETURN ( __MKOBJ(gcData) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8136
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8137
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8138
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8139
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8140
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8141
gcForHDC: aDeviceContextHandle
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8142
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8143
%{  /* NOCONTEXT */
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8144
    HDC hDC;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8145
    struct gcData *gcData;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8146
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8147
    if (__isExternalAddressLike(aDeviceContextHandle)) {
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8148
	hDC = _HDCVal(aDeviceContextHandle);
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8149
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8150
	if (! hDC) {
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8151
	    RETURN (nil);
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8152
	}
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8153
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8154
	gcData = newGcData();
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8155
	if (! gcData) {
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8156
	    RETURN (nil);
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8157
	}
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8158
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8159
#ifdef COUNT_RESOURCES
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8160
	__cnt_gcData++;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8161
	RESPRINTF(("CreateGcData %d\n",__cnt_gcData));
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8162
#endif
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8163
	gcData->_hDC = hDC;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8164
	gcData->doNotCacheOrRelease = 1;
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8165
	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
  8166
	RETURN ( __MKOBJ(gcData) );
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8167
    }
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8168
    RETURN (nil);
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8169
%}
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8170
!
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
  8171
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8172
primCreateBitmapFromArray:anArray width:w height:h
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8173
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8174
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8175
    HBITMAP newBitmapHandle;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  8176
    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
  8177
    int row, col;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8178
    unsigned char *cp, *bPits;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  8179
    unsigned char *b_bits = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8180
    int index;
2389
3703d9b22e33 handle externalBytes in drawBits & createBitmap
Claus Gittinger <cg@exept.de>
parents: 2383
diff changeset
  8181
    OBJ num;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8182
    unsigned char *allocatedBits = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8183
    unsigned char fastBits[10000];
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8184
5546
8387e6a32b6d Use __isArrayLike() and __isByteArrayLike()
Stefan Vogel <sv@exept.de>
parents: 5545
diff changeset
  8185
    if (__bothSmallInteger(w, h) && __isNonNilObject(anArray)) {
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8186
	b_width = __intVal(w);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8187
	b_height = __intVal(h);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8188
	bytesPerRowST = (b_width + 7) / 8;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8189
	bytesPerRowWN = ((b_width + 15) / 16) * 2;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8190
	padding = bytesPerRowWN - bytesPerRowST;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8191
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8192
	if ((padding == 0) && (__isByteArrayLike(anArray))) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8193
	    b_bits = __ByteArrayInstPtr(anArray)->ba_element;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8194
	    cp = 0;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8195
	} else {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8196
	    int nBytes = b_height * bytesPerRowWN;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8197
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8198
	    if (nBytes < sizeof(fastBits)) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8199
		cp = b_bits = fastBits;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8200
	    } else {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8201
		cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8202
		if (! cp) goto fail;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8203
	    }
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8204
	}
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8205
	if (cp) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8206
	    if (__qIsArrayLike(anArray)) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8207
		OBJ *op;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8208
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8209
		index = 1;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8210
		op = &(__ArrayInstPtr(anArray)->a_element[index - 1]);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8211
		for (row = b_height; row; row--) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8212
		    for (col = bytesPerRowST; col; col--) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8213
			num = *op++;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8214
			if (! __isSmallInteger(num))
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8215
			    goto fail;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8216
			*cp++ = __intVal(num);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8217
		    }
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8218
		    cp += padding;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8219
		}
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8220
	    } else if (__qIsByteArrayLike(anArray)) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8221
		unsigned char *pBits;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8222
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8223
		pBits = __ByteArrayInstPtr(anArray)->ba_element;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8224
		for (row = b_height; row; row--) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8225
		    for (col = bytesPerRowST; col; col--) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8226
			*cp++ = ( *pBits++ /*^ 0xFF*/ );
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8227
		    }
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8228
		    cp += padding;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8229
		}
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8230
	    } else {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8231
		goto fail;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8232
	    }
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8233
	}
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8234
	CPRINTF(("create bitmap ...\n"));
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8235
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8236
	newBitmapHandle = CreateBitmap(b_width, b_height, 1, 1, b_bits );
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8237
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8238
	if (newBitmapHandle ) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8239
#ifdef COUNT_BMP_RESOURCES
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8240
	    __cnt_bitmap++;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8241
	    RES_BMP_PRINTF(("CreateBitmap %x %d\n",newBitmapHandle,__cnt_bitmap));
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8242
#endif
6165
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
  8243
	    DDDDPRINTF(("returning bitmap %x ...\n", newBitmapHandle));
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8244
	    if (allocatedBits) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8245
		free(allocatedBits);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8246
	    }
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8247
	    RETURN ( __MKEXTERNALADDRESS(newBitmapHandle));
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8248
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8249
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8250
fail: ;
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  8251
    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
  8252
    if (allocatedBits) {
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8253
	CPRINTF(("freeing up bitmap bits ...\n"));
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  8254
	free(allocatedBits);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8255
    }
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  8256
    CPRINTF(("returning nil ...\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8257
    RETURN ( nil );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8258
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8259
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8260
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8261
primCreateWindowFor:aView type:typeSymbol
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8262
	  borderWidth:bWidth subViewOf:wsuperView
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8263
	  style:wStyle inputOnly:winputOnly
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8264
	  label:wlabel owner:wowner
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8265
	  icon:wicon iconMask:wiconMask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8266
	  moreArgs:moreArgs
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8267
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8268
%{  /* STACK: 16000 */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8269
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8270
    WNDCLASS wc;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8271
    long bg, bd, bw;
1706
ba1c3d039231 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1705
diff changeset
  8272
    int winStyleBits, winEXStyleBits;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8273
    int w, h, x, y;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8274
    int min_width, min_height;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8275
    int max_width, max_height;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8276
    OBJ eventMask;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8277
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8278
    HANDLE parentHandle;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8279
    HWND newWindowHandle;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8280
    OBJ xpos, ypos, wwidth, wheight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8281
    OBJ minWidth, minHeight, maxWidth, maxHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8282
    OBJ wsuperViewId, wcursorId, wiconId, wiconMaskId;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8283
    OBJ wiconWidth, wiconHeight;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8284
    OBJ windowType, windowClass, windowId;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8285
    OBJ stClassName;
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8286
    int isTopWindow = 0, isNativeWindow = 0, isMDIChild = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8287
    localWindowInfo *lI;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8288
    static createWindowInfo cwi;
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
  8289
    static int nextSequenceNr = 1;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8290
    unsigned char* cp;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8291
    HBITMAP        xBitMap, maskBitmap;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8292
    HICON          xIcon = (HICON)0;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8293
    ICONINFO       iconInfo;
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8294
    char *className;
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8295
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8296
#   define MAX_LABEL_SIZE       256
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8297
#   define MAX_CLASSNAME_SIZE   256
5088
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8298
    static wchar_t classNameBufferw[MAX_CLASSNAME_SIZE];
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8299
    static wchar_t windowNameBufferw[MAX_LABEL_SIZE];
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8300
    unsigned char fastBits[10000];
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8301
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8302
    xpos = __ArrayInstPtr(moreArgs)->a_element[0];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8303
    ypos = __ArrayInstPtr(moreArgs)->a_element[1];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8304
    wwidth = __ArrayInstPtr(moreArgs)->a_element[2];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8305
    wheight = __ArrayInstPtr(moreArgs)->a_element[3];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8306
    minWidth = __ArrayInstPtr(moreArgs)->a_element[4];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8307
    minHeight = __ArrayInstPtr(moreArgs)->a_element[5];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8308
    maxWidth = __ArrayInstPtr(moreArgs)->a_element[6];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8309
    maxHeight = __ArrayInstPtr(moreArgs)->a_element[7];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8310
    wsuperViewId = __ArrayInstPtr(moreArgs)->a_element[8];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8311
    wcursorId = __ArrayInstPtr(moreArgs)->a_element[9];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8312
    wiconId = __ArrayInstPtr(moreArgs)->a_element[10];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8313
    wiconMaskId = __ArrayInstPtr(moreArgs)->a_element[11];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8314
    wiconWidth = __ArrayInstPtr(moreArgs)->a_element[12];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8315
    wiconHeight = __ArrayInstPtr(moreArgs)->a_element[13];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8316
    windowType = __ArrayInstPtr(moreArgs)->a_element[14];
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8317
    windowClass = __ArrayInstPtr(moreArgs)->a_element[15];
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8318
    eventMask = __ArrayInstPtr(moreArgs)->a_element[16];
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8319
    stClassName = __ArrayInstPtr(moreArgs)->a_element[17];
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8320
    bg = WhitePixel;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8321
    bd = BlackPixel;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8322
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8323
    /* get bitmap for icon */
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8324
    if ( __isExternalAddress(wiconId) ) {
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8325
	xBitMap = _HBITMAPVAL( wiconId );
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8326
	if ( xBitMap != 0 ) {
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8327
	    BITMAP bm;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8328
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8329
	    if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8330
		int d = bm.bmPlanes * bm.bmBitsPixel;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8331
		BYTE *ep;
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8332
		int height, width;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8333
		int nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8334
		unsigned char *allocatedBits = 0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8335
		int privateMask = 0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8336
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8337
		if ( __isExternalAddress(wiconMaskId) ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8338
		    maskBitmap = _HBITMAPVAL( wiconMaskId );
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8339
		} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8340
		    if (wiconMaskId != nil) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8341
			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
  8342
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8343
		    maskBitmap = 0;
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8344
		}
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8345
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8346
		/*
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8347
		 * if there is no mask, generate one
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8348
		 */
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8349
		if (maskBitmap == 0) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8350
		    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
  8351
		    height = __intVal( wiconHeight );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8352
		    width  = __intVal( wiconWidth  );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8353
		    nBytes = ( width + 15 ) / 8;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8354
		    nBytes = height * nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8355
		    if (nBytes < sizeof(fastBits)) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8356
			ep = fastBits;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8357
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8358
			ep = allocatedBits = (unsigned char *) malloc(nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8359
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8360
		    if ( ep == 0 ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8361
			PRINTF(( "WinWorkstat [warning]: malloc failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8362
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8363
			memset(ep, 0, nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8364
			maskBitmap = CreateBitmap(width, height, 1, 1, ep );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8365
			if ( maskBitmap == NULL ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8366
			    PRINTF(( "WinWorkstat [warning]: mask CREATION failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8367
			} else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8368
			    privateMask = 1;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8369
			}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8370
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8371
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8372
		if ( maskBitmap != NULL ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8373
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8374
		    iconInfo.fIcon = TRUE;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8375
		    iconInfo.hbmMask  = maskBitmap;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8376
		    iconInfo.hbmColor = xBitMap;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8377
		    xIcon = CreateIconIndirect( &iconInfo );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8378
		    if (privateMask) {
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
  8379
			_DeleteObject( maskBitmap, __LINE__ );
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8380
		    }
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8381
		} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8382
		    PRINTF(( "WinWorkstat [warning]: no mask for icon !\n" ));
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8383
		}
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8384
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8385
		if (allocatedBits) {
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8386
		    free(allocatedBits);
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8387
		}
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8388
	    }
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8389
	} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8390
	    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
  8391
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8392
    } else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8393
	if (wiconId != nil) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
  8394
	    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
  8395
	}
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
  8396
    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8397
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8398
    if (__bothSmallInteger(wwidth, wheight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8399
	w = __intVal(wwidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8400
	h = __intVal(wheight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8401
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8402
	w = h = 100;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8403
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8404
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8405
    if (__bothSmallInteger(xpos, ypos)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8406
	x = __intVal(xpos);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8407
	y = __intVal(ypos);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8408
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8409
	x = y = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8410
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8411
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8412
    if (__bothSmallInteger(minWidth, minHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8413
	min_width = __intVal(minWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8414
	min_height = __intVal(minHeight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8415
    } else {
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8416
	DPRINTF(("WinWorkstat [warning]: minWidth/minHeight not integer\n"))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8417
	min_width = min_height = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8418
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8419
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8420
    if (__bothSmallInteger(maxWidth, maxHeight)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8421
	max_width = __intVal(maxWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8422
	max_height = __intVal(maxHeight);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8423
    } else {
5843
9493852cc836 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5842
diff changeset
  8424
	DPRINTF(("WinWorkstat [warning]: maxWidth/maxHeight not integer\n"))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8425
	max_width = max_height = 10000;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8426
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8427
1706
ba1c3d039231 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1705
diff changeset
  8428
    winStyleBits = winEXStyleBits = 0;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8429
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8430
    if (__isSmallInteger(bWidth)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8431
	bw = __intVal(bWidth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8432
	if (bw) {
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8433
	    winStyleBits |= WS_BORDER;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8434
	    bw = 1;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8435
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8436
    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8437
	bw = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8438
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8439
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8440
    className = app_name;
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
  8441
    if (__isStringLike(windowClass)) {
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8442
	className = __stringVal(windowClass);
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  8443
	NDPRINTF(("className: %s\n", className));
5088
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8444
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8445
	if (__isInteger(wStyle)) {
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8446
	    isNativeWindow = 1;
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8447
	    winStyleBits |= __longIntVal(wStyle);
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  8448
	    NDPRINTF(("winStyleBits: %x\n", winStyleBits));
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8449
	} else {
5088
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8450
	    if (windowType != nil) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8451
		if (windowType == @symbol(RadioButton)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8452
		    isNativeWindow = 1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8453
		    winStyleBits |= BS_RADIOBUTTON;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8454
		    NDPRINTF(("class: %s - winStyleBits BS_RADIOBUTTON: %x\n", className, winStyleBits));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8455
		} else if (windowType == @symbol(CheckBox)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8456
		    isNativeWindow = 1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8457
		    winStyleBits |= BS_CHECKBOX;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8458
		    NDPRINTF(("class: %s - winStyleBits BS_CHECKBOX: %x\n", className, winStyleBits));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8459
		} else if (windowType == @symbol(HorizontalScrollBar)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8460
		    isNativeWindow = 1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8461
		    winStyleBits |= SBS_HORZ;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8462
		    NDPRINTF(("class: %s - winStyleBits SBS_HORZ: %x\n", className, winStyleBits));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8463
		} else if (windowType == @symbol(VerticalScrollBar)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8464
		    isNativeWindow = 1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8465
		    winStyleBits |= SBS_VERT;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8466
		    NDPRINTF(("class: %s - winStyleBits SBS_VERT: %x\n", className, winStyleBits));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8467
		} else if (windowType == @symbol(Button)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8468
		    isNativeWindow = 1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8469
		    NDPRINTF(("class: %s\n", className));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8470
		} else if (windowType == @symbol(OwnerDrawButton)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8471
		    isNativeWindow = 1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8472
		    winStyleBits |= BS_OWNERDRAW;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8473
		    NDPRINTF(("class: %s - winStyleBits BS_OWNERDRAW: %x\n", className, winStyleBits));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8474
		}
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8475
	    }
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8476
	}
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8477
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8478
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8479
    if (__isExternalAddress(wsuperViewId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8480
	/*
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8481
	 * a child window
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8482
	 */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8483
	parentHandle = _HANDLEVal(wsuperViewId);
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8484
	if (wStyle == @symbol(mdiChild)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8485
	    isMDIChild = 1;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8486
	}
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8487
    } else {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8488
	parentHandle = NULL;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8489
	isTopWindow = 1;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8490
    }
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8491
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8492
    if (!isTopWindow && !isMDIChild) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8493
	/*
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8494
	 * a child window
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8495
	 */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8496
	winStyleBits |= WS_CHILD;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8497
	if (winputOnly != true) {
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8498
	    winStyleBits |= (WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8499
	    /*winStyleBits |= WS_CLIPCHILDREN;*/
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8500
	    DPRINTF(("parent handle=%x\n", parentHandle));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8501
	} else {
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8502
	    winEXStyleBits |= WS_EX_TRANSPARENT;
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8503
	    DPRINTF(("inputview parent handle=%x\n", parentHandle));
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8504
	}
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8505
#if 0
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8506
	winEXStyleBits |= WS_EX_NOPARENTNOTIFY;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8507
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8508
    } else {
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  8509
	/*
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8510
	 * a top window (regular / popUp / dialog) or MDIChild
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  8511
	 */
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8512
	if (isMDIChild) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8513
	    winEXStyleBits |= WS_EX_MDICHILD;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8514
	}
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8515
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8516
	if (! isMDIChild)
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8517
	{
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  8518
#ifdef TOPWINDOWCLASS
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8519
	    this could fail, since a pointer to local buf is passed
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8520
	    to the window-creation code (in the other thread ...)
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8521
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8522
	    static winCount = 1;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8523
	    char buf[300];
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8524
	    char *stName;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8525
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8526
# ifdef __BORLANDC__
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8527
	    struct timeb timebuffer;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8528
	    ftime(&timebuffer);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8529
# else
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8530
	    struct _timeb timebuffer;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8531
	    _ftime(&timebuffer);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8532
# endif
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8533
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
  8534
	    if (__isStringLike(stClassName)) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8535
		stName = __stringVal(stClassName);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8536
	    } else {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8537
		stName = app_name;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8538
	    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8539
	    sprintf(buf, "S%d.%d%s", HIWORD(timebuffer.time), ++winCount, stName);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8540
	    DPRINTF(("topview - registerClass:%s\n",buf));
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8541
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8542
	    wc.style = /* CS_HREDRAW | CS_VREDRAW | CS_OWNDC  |*/ CS_DBLCLKS;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8543
	    wc.lpfnWndProc = (WNDPROC) MainWndProc;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8544
	    wc.cbClsExtra = 0;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8545
	    wc.cbWndExtra = N_WINDOW_PRIVATE;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8546
	    wc.hInstance = (HANDLE) __getHInstance();
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8547
	    if (xIcon) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8548
		wc.hIcon   = xIcon;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8549
		/* 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
  8550
	    } else {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8551
		wc.hIcon = NULL;        /* THIS MUST BE NULL TO DELETE ICONS */
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8552
	    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8553
	    wc.hCursor = 0 /* LoadCursor(NULL, IDC_ARROW) */;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8554
	    wc.hbrBackground = 0; /*CreateSolidBrush (bg);*/
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8555
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8556
	    wc.lpszMenuName =  NULL;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8557
	    wc.lpszClassName = buf;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8558
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8559
	    if (!RegisterClass(&wc)) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8560
		PRINTF(("RegisterClass failed\n"));
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8561
		RETURN( nil );
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8562
	    }
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8563
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8564
	    className = buf;
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8565
#endif /* TOPWINDOWCLASS */
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8566
	}
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
  8567
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8568
	if (wStyle == @symbol(popUp)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8569
	    winStyleBits |= WS_POPUP;
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8570
	    // winStyleBits |= WS_DISABLED;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8571
	    winEXStyleBits |= WS_EX_TOOLWINDOW;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
  8572
	    CPRINTF(("Create popUpWindow\n"));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8573
#if 0
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8574
	    parentHandle = GetActiveWindow();
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8575
#endif
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8576
	} else if (wStyle == @symbol(popUpWithFrame)) {
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8577
	    winStyleBits |= WS_POPUP | WS_THICKFRAME /* | WS_CAPTION | DS_MODALFRAME | WS_SIZEBOX */ ;
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8578
	    // winStyleBits |= WS_DISABLED;
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8579
	    // winEXStyleBits |= WS_EX_TOOLWINDOW;
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8580
	    CPRINTF(("Create popUpWindow\n"));
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8581
#if 0
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8582
	    parentHandle = GetActiveWindow();
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8583
#endif
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8584
4257
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8585
	} else if ((wStyle == @symbol(dialog)) || (wStyle == @symbol(toolDialog))) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8586
	    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
  8587
	    winStyleBits |= WS_POPUP;
2419
b2633c30ff7a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
  8588
	    winStyleBits |= DS_NOIDLEMSG;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  8589
	    //winEXStyleBits |= WS_EX_TOOLWINDOW;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8590
	    if ((min_width || min_height)
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8591
	     && (min_width == max_width)
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8592
	     && (min_height == max_height)) {
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8593
		winStyleBits &= ~WS_THICKFRAME;
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  8594
	    }
4257
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8595
	    if (wStyle == @symbol(toolDialog)) {
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8596
		winEXStyleBits |= WS_EX_TOOLWINDOW;
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8597
	    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8598
	} else if (wStyle == @symbol(undecorated)) {
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8599
	    winStyleBits |= WS_OVERLAPPED;
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8600
	    winEXStyleBits |= WS_EX_WINDOWEDGE;
5726
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8601
	} else if (wStyle == @symbol(undecoratedResizable)) {
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8602
	    winStyleBits |= WS_OVERLAPPED | WS_THICKFRAME;
7dba4467bf1b experimental window decorations
Claus Gittinger <cg@exept.de>
parents: 5708
diff changeset
  8603
	    winEXStyleBits |= WS_EX_WINDOWEDGE;
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8604
	} else if (isMDIChild) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8605
	    winStyleBits |= WS_OVERLAPPED | WS_CAPTION | DS_MODALFRAME | WS_SYSMENU | WS_SIZEBOX;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8606
	    if ((min_width || min_height)
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8607
	     && (min_width == max_width)
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8608
	     && (min_height == max_height)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8609
		winStyleBits &= ~WS_THICKFRAME;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8610
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8611
	} else {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  8612
	    //winStyleBits |= WS_OVERLAPPEDWINDOW;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8613
	    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
  8614
	    //winEXStyleBits |= WS_EX_CLIENTEDGE;
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  8615
	    winEXStyleBits |= WS_EX_WINDOWEDGE;
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
  8616
	    //winEXStyleBits |= WS_EX_ACCEPTFILES;
4257
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8617
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8618
	    if (wStyle == @symbol(toolWindow)) {
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8619
		winEXStyleBits |= WS_EX_TOOLWINDOW;
6f836f8f367d *** empty log message ***
ca
parents: 4253
diff changeset
  8620
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8621
	}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  8622
	winStyleBits |= WS_CLIPCHILDREN;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8623
    }
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8624
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8625
    rec.left = x;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8626
    rec.top = y;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8627
    rec.right = x + w;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8628
    rec.bottom = y+ h;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8629
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8630
    /* use static memory for the createwindowInfo;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8631
     * 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
  8632
     * 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
  8633
     * when in a sizeMove-loop.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8634
     * (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
  8635
     *  early via the pending- mechanism)
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8636
     * 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
  8637
     * 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
  8638
     * 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
  8639
     */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8640
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8641
    /*
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8642
     * check if previous request has been properly processed ...
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8643
     */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8644
    if (cwi.sequenceNr && (cwi.sequenceNr != INVALIDATED_CWI)) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8645
	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
  8646
	/* this prevents the event processor from interpreting this message */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8647
	cwi.sequenceNr = nextSequenceNr;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8648
    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8649
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8650
    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
  8651
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8652
#ifdef ADJUSTWINDOW
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8653
    AdjustWindowRectEx(&rec, winStyleBits, 0, cwi.winStyleBitsEx);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8654
    w = rec.right - rec.left;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8655
    h = rec.bottom - rec.top;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8656
#endif
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
  8657
4265
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  8658
    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
  8659
		((wStyle == @symbol(popUp)) ? " popUp" : ""),
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  8660
		x, y, w, h,
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  8661
		bw, parentHandle, className,
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
  8662
		winStyleBits, winEXStyleBits));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8663
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8664
    /* allocate localMemory for Window */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8665
    lI = (localWindowInfo *) malloc(sizeof(localWindowInfo));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8666
    if (! lI) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8667
	console_fprintf(stderr, "WinWorkstation [error]: malloc failed in CreateWindow\n");
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8668
	RETURN ( nil );
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8669
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8670
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8671
    memset(lI, 0, sizeof(localWindowInfo));
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  8672
    lI->mouseX = lI->mouseY = -9999;
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  8673
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8674
    if (isTopWindow) {
6565
a3955bc42356 class: WinWorkstation
ca
parents: 6494
diff changeset
  8675
/****** MULTI SCREEN   CATZKERN *********
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8676
	if (rec.left < 0) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8677
	    rec.left = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8678
	    rec.right = w;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8679
	}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8680
	if (rec.top < 0) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8681
	    rec.top = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8682
	    rec.bottom = h;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8683
	}
6565
a3955bc42356 class: WinWorkstation
ca
parents: 6494
diff changeset
  8684
****** MULTI SCREEN   CATZKERN *********/
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
  8685
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8686
	lI->flag |= LI_TOPWIN;
2462
7e631ccec09d tut nicht (GUI builder open)
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
  8687
    } else {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8688
	if (bw) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8689
	    // adjust for border
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8690
	    rec.left++;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8691
	    rec.top++;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8692
	}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8693
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8694
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  8695
    if (winputOnly == true) {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8696
	lI->flag |= LI_INPUTWIN;
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
  8697
    }
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8698
    if (isNativeWindow) {
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
  8699
	NDPRINTF(("set native flag\n"));
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8700
	lI->flag |= LI_NATIVEWIN;
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8701
    }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8702
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8703
    if (wStyle == @symbol(popUp)) {
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8704
	cwi.className = wapp_namePopup;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8705
    } else {
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8706
	if (wStyle == @symbol(dialog)) {
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8707
	    cwi.className = wapp_nameDialog;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8708
	} else {
5088
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8709
	    ch2wch(className, classNameBufferw, MAX_CLASSNAME_SIZE);
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8710
	    cwi.className = classNameBufferw;
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8711
	}
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
  8712
    }
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  8713
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8714
    cwi.winStyleBits = winStyleBits;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8715
    cwi.parentHandle = parentHandle;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8716
    cwi.x = rec.left;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8717
    cwi.y = rec.top;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8718
    cwi.dx = rec.right - rec.left;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8719
    cwi.dy = rec.bottom - rec.top;
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8720
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8721
    if (isTopWindow | isMDIChild) {
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8722
	rec.left = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8723
	rec.top = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8724
	rec.right = min_width;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8725
	rec.bottom = min_height;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8726
#ifdef ADJUSTWINDOW
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8727
	AdjustWindowRectEx(&rec, winStyleBits, 0, cwi.winStyleBitsEx);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8728
#endif
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8729
	lI->minWidth = rec.right - rec.left;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8730
	lI->minHeight = rec.bottom - rec.top;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8731
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8732
	rec.left = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8733
	rec.top = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8734
	rec.right = max_width;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8735
	rec.bottom = max_height;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8736
#ifdef ADJUSTWINDOW
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8737
	AdjustWindowRectEx(&rec, winStyleBits, 0, cwi.winStyleBitsEx);
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8738
#endif
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8739
	lI->maxWidth = rec.right - rec.left;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8740
	lI->maxHeight = rec.bottom - rec.top;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8741
    } else {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8742
	lI->minWidth = lI->minHeight = 0;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8743
	lI->maxWidth = lI->maxHeight = 9999;
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8744
    }
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  8745
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  8746
    lI->viewBgBrush = __whiteBrush;
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
  8747
    lI->viewBgColor = WhitePixel;
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
  8748
    lI->bdColor = BlackPixel;
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
  8749
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8750
    if (__isSmallInteger(eventMask))
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8751
	lI->eventMask = __intVal(eventMask);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8752
    else
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  8753
	lI->eventMask = ~0;
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  8754
    DPRINTF(("eventMask is %x\n", lI->eventMask));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8755
#ifdef DEBUGMASK1
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8756
    printMask(lI->eventMask);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8757
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8758
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8759
    lI->bw = bw;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8760
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8761
    cwi.newWinHandle = newWindowHandle = NULL;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8762
    cwi.windowName = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8763
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8764
    if (isTopWindow | isMDIChild) {
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
  8765
	if (__isStringLike(wlabel)) {
5088
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8766
	    ch2wch((char *)__stringVal(wlabel), windowNameBufferw, MAX_LABEL_SIZE);
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8767
	    cwi.windowName = windowNameBufferw;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8768
	} else
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8769
	    if (__isUnicode16String(wlabel)) {
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8770
		int l = __unicode16StringSize(wlabel);
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8771
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8772
		if (l >= MAX_LABEL_SIZE) l = MAX_LABEL_SIZE-1;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8773
		memmove(windowNameBufferw, __unicode16StringVal(wlabel), l*sizeof(wchar_t));
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8774
		windowNameBufferw[ l ] = 0;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8775
		cwi.windowName = windowNameBufferw;
cbd228a6088b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5072
diff changeset
  8776
	    }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8777
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8778
2665
4b88034ccb36 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2664
diff changeset
  8779
    cwi.infoWasRead = 0;
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
  8780
    cwi.localWindowInfo = lI;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8781
    cwi.sequenceNr = nextSequenceNr;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8782
    nextSequenceNr = (nextSequenceNr + 1) & 0x7FFF;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8783
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8784
#ifndef NEW_CREATE_EVENT
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8785
    cwi.hCreateEvent = hCreateEvent;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8786
    ResetEvent(cwi.hCreateEvent);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8787
#else
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8788
    /* creating a new event does not work - why ? */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8789
    cwi.hCreateEvent = CreateEvent(
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8790
	NULL,        /* no security attributes */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8791
	FALSE,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8792
	FALSE,
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8793
	NULL);       /* name of mutex */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8794
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8795
    if (cwi.hCreateEvent == NULL) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8796
	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
  8797
	cwi.sequenceNr = INVALIDATED_CWI;
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  8798
	free(lI);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8799
	RETURN ( nil );
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8800
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8801
#endif
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8802
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8803
    /*
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8804
     * kludge to allow for createWindow while in sizeMove processing loop
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8805
     */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8806
    if (pendingCREATEWINDOWInfo) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8807
	console_fprintf(stderr, "WinWorkstation [error]: oops - pending create\n");
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8808
    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8809
    pendingCREATEWINDOWInfo = &cwi;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8810
    pendingSequenceNr = cwi.sequenceNr;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8811
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  8812
    if (PostThreadMessage(_dispatchThreadId, WM_THREAD_CREATEWINDOW, (INT)(cwi.sequenceNr), (INT)(&cwi)) == FALSE) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8813
	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
  8814
					_dispatchThreadId, GetLastError() );
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8815
	free(lI);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8816
	RETURN (nil);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8817
    }
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8818
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8819
    if (cwi.newWinHandle != NULL) {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8820
	cwi.sequenceNr = INVALIDATED_CWI;
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
  8821
	cwi.hCreateEvent = NULL;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8822
	/* wow - that was quick ... */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8823
    } else {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8824
	DWORD dwWaitResult;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8825
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8826
	/* wait for the window to be created ... */
4504
0f0a6f7fabd5 lockEvent bug (workaround ?)
Claus Gittinger <cg@exept.de>
parents: 4503
diff changeset
  8827
	dwWaitResult = WaitForSingleObject(hCreateEvent, 5000L);
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8828
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8829
	/* no longer want to get informed ... */
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8830
	cwi.hCreateEvent = NULL;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8831
	cwi.sequenceNr = INVALIDATED_CWI;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8832
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8833
	switch (dwWaitResult) {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8834
	    // The thread got mutex ownership.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8835
	    case WAIT_OBJECT_0:
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8836
		break;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8837
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8838
	    // Cannot get mutex ownership due to time-out.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8839
	    case WAIT_TIMEOUT:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8840
		DEBUGFPRINTF((stderr, "WinWorkstation [error]: oops - timeout in CreateWindow\n"));
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8841
		break;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8842
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8843
	    // Got ownership of the abandoned mutex object.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8844
	    default:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8845
		DEBUGFPRINTF((stderr, "WinWorkstation [warning]: CreateEvent abandoned\n"));
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8846
		break;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8847
	}
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8848
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8849
#ifdef NEW_CREATE_EVENT
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8850
	CloseHandle(cwi.hCreateEvent);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8851
#endif
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8852
    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8853
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8854
    pendingCREATEWINDOWInfo = 0;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8855
    newWindowHandle = cwi.newWinHandle;
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8856
    DPRINTF(("handle = %x\n", newWindowHandle));
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8857
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8858
    if (! newWindowHandle) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8859
	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
  8860
			cwi.errCode, cwi.errCode, __LINE__ );
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  8861
	if (cwi.infoWasRead) {
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  8862
	    free(lI);
4284
5efcb512f038 *** empty log message ***
ca
parents: 4281
diff changeset
  8863
	} else {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8864
	    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
  8865
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8866
	RETURN ( nil );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8867
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8868
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8869
#ifdef CACHE_LAST_DC
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8870
    if (lastGcData && (lastGcHWIN == newWindowHandle)) {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8871
	_releaseDC(lastGcData);
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8872
    }
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8873
#endif
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8874
#ifdef CACHE_LAST_WM_PAINT_DC
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8875
    if (last_wm_paint_dc && (last_wm_paint_win == newWindowHandle)) {
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8876
	ReleaseDC(newWindowHandle, last_wm_paint_dc);
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8877
	last_wm_paint_win = last_wm_paint_dc = 0;
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8878
    }
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8879
#endif
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
  8880
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  8881
    windowId = __MKOBJ(newWindowHandle);
4368
f8d0e4be74eb raising windows
penk
parents: 4367
diff changeset
  8882
#if 1
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8883
    if (isTopWindow | isMDIChild) {
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8884
	/*
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8885
	 * mhmh - what is that raise for ?
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8886
	 */
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8887
	SetWindowPos(newWindowHandle, HWND_TOP, 0, 0, 0, 0,
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8888
		     SWP_NOSENDCHANGING |
4368
f8d0e4be74eb raising windows
penk
parents: 4367
diff changeset
  8889
		     /* SWP_NOACTIVATE | */ SWP_NOMOVE | SWP_NOSIZE);
f8d0e4be74eb raising windows
penk
parents: 4367
diff changeset
  8890
    } else {
f8d0e4be74eb raising windows
penk
parents: 4367
diff changeset
  8891
	SetWindowPos(newWindowHandle, HWND_TOP, 0, 0, 0, 0,
f8d0e4be74eb raising windows
penk
parents: 4367
diff changeset
  8892
		     SWP_NOSENDCHANGING |
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8893
		     SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8894
    }
4143
e378d1d54f75 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4134
diff changeset
  8895
#endif
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
  8896
    if (isTopWindow | isMDIChild) {
2697
0fbd675cf5b2 update region processing
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
  8897
	BringWindowToTop(newWindowHandle);
0fbd675cf5b2 update region processing
Claus Gittinger <cg@exept.de>
parents: 2696
diff changeset
  8898
    }
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
  8899
    DragAcceptFiles(newWindowHandle, 1);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8900
4240
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
  8901
    if (isNativeWindow) {
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
  8902
	if (winStyleBits & (SBS_HORZ | SBS_VERT)) {
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
  8903
	    SetScrollRange(newWindowHandle, SB_CTL, 0, 100, 0);
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
  8904
	    SetScrollPos(newWindowHandle, SB_CTL, 0, 0);
4240
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
  8905
	}
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
  8906
    }
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
  8907
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  8908
#ifndef TOPWINDOWCLASS
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8909
    if (xIcon) {
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  8910
	SendMessage(newWindowHandle, WM_SETICON, (WPARAM)ICON_SMALL, (LPARAM)xIcon);
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
  8911
	SendMessage(newWindowHandle, WM_SETICON, (WPARAM)ICON_BIG, (LPARAM)xIcon);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8912
    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8913
#endif
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
  8914
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  8915
    DPRINTF(("done - create h=%x\n", newWindowHandle));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8916
    RETURN (windowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8917
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8918
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8919
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8920
primDestroyView:aView withId:aWindowId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8921
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  8922
%{  /* NOCONTEXT */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8923
    HICON oldIcon;
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8924
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8925
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8926
	HWND win = _HWNDVal(aWindowId);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  8927
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  8928
	if (win && IsWindow(win)) {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
  8929
#ifndef TOPWINDOWCLASS
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  8930
# ifdef _WIN64
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  8931
	    oldIcon = (HICON) GetClassLongPtr(win, GCLP_HICON);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  8932
	    SetClassLongPtr(win, GCLP_HICON, (INT)0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  8933
# else
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  8934
	    oldIcon = (HICON) GetClassLong(win, GCL_HICON);
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  8935
	    SetClassLong(win, GCL_HICON, (DWORD)0);
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  8936
# endif
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  8937
	    /* 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
  8938
	    if ( oldIcon ) {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8939
		if ( DestroyIcon( oldIcon )) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8940
		    DPRINTF(( "Old icon deleted\n" ));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  8941
		} else {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8942
		    console_fprintf(stderr, "failed to destroy icon\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8943
		}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8944
	    }
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8945
#endif
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  8946
	   /*console_printf("post WM_THREAD_DESTROYWINDOW\n");*/
2752
a5d5305850e0 fixed leftover pixel-garbage (leftOver view)
Claus Gittinger <cg@exept.de>
parents: 2746
diff changeset
  8947
	    PostMessage(win, WM_THREAD_DESTROYWINDOW, 0, 0);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  8948
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8949
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8950
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8951
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8952
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8953
rootWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8954
    "return the id of the root window.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  8955
     This is the window you see as background,
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8956
     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
  8957
     since some window managers install a virtual root window on top
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8958
     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
  8959
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  8960
    ^ rootWin
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8961
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  8962
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8963
!WinWorkstation methodsFor:'clipboard'!
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  8964
4748
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8965
getClipboardObjectFor:drawableId
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8966
    "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
  8967
     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
  8968
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8969
    |currentSequenceNumber|
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8970
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8971
    currentSequenceNumber := self getClipboardSequenceNumber.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8972
    lastClipboardSequenceNumber ~= currentSequenceNumber ifTrue:[
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8973
	"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
  8974
	 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
  8975
	 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
  8976
	 behavior."
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8977
	copyBuffer := self getClipboardData.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8978
	lastClipboardSequenceNumber := currentSequenceNumber.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8979
    ].
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8980
    ^ copyBuffer
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8981
!
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8982
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8983
getClipboardText:selectionBufferSymbol for:drawableId
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8984
     "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
  8985
      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
  8986
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8987
    |currentSequenceNumber|
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8988
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8989
    currentSequenceNumber := self getClipboardSequenceNumber.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8990
    lastClipboardSequenceNumber ~= currentSequenceNumber ifTrue:[
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8991
	"copyBuffer is invalid, fill it from the windows clipboard.
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8992
	 Even if we could not decode the windows clipboard,
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8993
	 we intentionally set the copyBuffer to nil to get a consistent
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8994
	 behavior."
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8995
	copyBuffer := self getClipboardData.
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  8996
	lastClipboardSequenceNumber := currentSequenceNumber.
4748
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8997
    ].
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  8998
    ^ self copyBufferAsString
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  8999
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9000
    "
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9001
     Screen current getClipboardText:#clipboard for:nil
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
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9004
    "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
  9005
!
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9006
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9007
setClipboardObject:something owner:drawableId
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9008
    "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
  9009
     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
  9010
     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
  9011
     to other applications."
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9012
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9013
    something isString ifTrue:[
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9014
	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
  9015
	^ self
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9016
    ].
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9017
    something isStringCollection ifTrue:[
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9018
	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
  9019
	^ self
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9020
    ].
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9021
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9022
    "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
  9023
     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
  9024
    lastClipboardSequenceNumber := self getClipboardSequenceNumber.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9025
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9026
    "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
  9027
    "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
  9028
!
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9029
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9030
setClipboardText:something owner:drawableId
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9031
    "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
  9032
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9033
    |result|
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9034
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9035
    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
  9036
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9037
    "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
  9038
    lastClipboardSequenceNumber := self getClipboardSequenceNumber.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9039
    ^ result.
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9040
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9041
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9042
    "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
  9043
    "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
  9044
! !
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9045
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9046
!WinWorkstation methodsFor:'clipboard-private'!
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9047
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9048
getClipboardData
4748
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9049
    "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
  9050
     Answer a string on success or nil otherwise.
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9051
     Caveat: for now, only Text and UnicodeText are supported"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9052
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9053
    |data|
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9054
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9055
    (data := self getUnicodeClipboardData) notNil ifTrue:[^ data].
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9056
    (data := self getTextClipboardData) notNil ifTrue:[^ data].
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9057
    ^ nil
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9058
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9059
    "Modified: / 09-10-2007 / 12:47:02 / cg"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9060
!
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9061
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9062
getClipboardDataBytes:format
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9063
    "get the contents of the windows clipboard as raw bytes.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9064
     Answer an image on success or nil otherwise."
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9065
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9066
    |bytes|
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9067
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9068
%{
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9069
    HANDLE hData;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9070
    unsigned char *src, *p;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9071
    WIDECHAR *w_src, *w_p;
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9072
    int fmt;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9073
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9074
    if (format == @symbol(CF_TIFF)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9075
	fmt = CF_TIFF;
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9076
    } else if (format == @symbol(CF_BITMAP)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9077
	fmt = CF_BITMAP;
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9078
    } else if (format == @symbol(CF_DIB)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9079
	fmt = CF_DIB;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9080
    } else
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9081
	goto badFormat;
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9082
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9083
    if (IsClipboardFormatAvailable(fmt)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9084
	int len;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9085
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  9086
	if (OpenClipboard(NULL)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9087
	    hData = GetClipboardData(fmt);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9088
	    if (hData) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9089
		len = GlobalSize(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9090
		src = GlobalLock(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9091
		if (src) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9092
		    bytes = __MKBYTEARRAY(src, len);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9093
		}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9094
		GlobalUnlock(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9095
		CloseClipboard();
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  9096
		DDPRINTF(("WinWorkstation [info]: clipBoard data size is <%d>\n", len));
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9097
		RETURN(bytes);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9098
	    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9099
	}
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9100
    }
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9101
badFormat: ;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9102
%}.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9103
    ^ nil
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9104
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9105
    "
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9106
     Screen current getClipboardDataBytes:#CF_TIFF
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9107
     Screen current getClipboardDataBytes:#CF_BITMAP
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9108
     Screen current getClipboardDataBytes:#CF_DIB
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9109
    "
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9110
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9111
    "Created: / 09-10-2007 / 13:11:12 / cg"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9112
    "Modified: / 09-10-2007 / 14:18:26 / cg"
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9113
!
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9114
4748
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9115
getClipboardOwner
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9116
    "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
  9117
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9118
%{
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9119
    HANDLE hWnd;
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9120
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9121
    hWnd = GetClipboardOwner();
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9122
    RETURN(__MKEXTERNALADDRESS(hWnd));
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9123
%}
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9124
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9125
   "
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9126
	Screen current getClipboardOwner
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9127
   "
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9128
!
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9129
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9130
getClipboardSequenceNumber
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9131
    "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
  9132
     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
  9133
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9134
%{
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9135
    DWORD sequenceNumber;
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9136
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9137
    sequenceNumber = GetClipboardSequenceNumber();
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9138
    RETURN(__MKUINT(sequenceNumber));
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9139
%}
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9140
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9141
   "
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9142
	Screen current getClipboardSequenceNumber
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9143
   "
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9144
!
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9145
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9146
getImapeClipboardData
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9147
    "get the contents of the windows clipboard.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9148
     Answer an image on success or nil otherwise."
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9149
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9150
    |data|
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9151
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9152
    (data := self getClipboardDataBytes:#CF_TIFF) notNil ifTrue:[
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9153
	"/ tiff image in data...
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9154
	^ "TIFFReader fromBytes:data" nil
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9155
    ].
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9156
    (data := self getClipboardDataBytes:#CF_DIB) notNil ifTrue:[
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9157
	"/ device independent bitmap image in data...
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9158
	^ "TIFFReader fromBytes:data" nil
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9159
    ].
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9160
    ^ nil
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9161
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9162
    "Created: / 09-10-2007 / 14:19:53 / cg"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9163
!
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9164
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9165
getTextClipboardData
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9166
    "get the contents of the windows clipboard.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9167
     Answer a string on success or nil otherwise.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9168
     Caveat: for now, only Text is supported"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9169
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9170
%{
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9171
    HANDLE hData;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9172
    OBJ s;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9173
    unsigned char *src, *p;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9174
    WIDECHAR *w_src, *w_p;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9175
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9176
    /* check for format CF_TEXT */
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9177
    if (IsClipboardFormatAvailable(CF_TEXT)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9178
	int nRemain, len, realLen;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9179
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  9180
	if (OpenClipboard(NULL)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9181
	    hData = GetClipboardData(CF_TEXT);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9182
	    src = GlobalLock(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9183
	    len = src ? strlen(src) : 0;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9184
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9185
	    /* 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
  9186
	    for (realLen=nRemain=len, p=src; nRemain; ) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9187
		unsigned char ch;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9188
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9189
		ch = *p++; nRemain--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9190
		if (ch == 0x0D) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9191
		    if (nRemain && (*p == 0x0A)) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9192
			p++; nRemain--;realLen--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9193
		    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9194
		}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9195
	    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9196
	    s = __MKEMPTYSTRING(realLen);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9197
	    if (s != nil) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9198
		for (p=__stringVal(s); len; ) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9199
		    unsigned char ch;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9200
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9201
		    *p = ch = *src++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9202
		    len--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9203
		    if (len && (ch == 0x0D) && (*src == 0x0A)) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9204
			*p = 0x0A;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9205
			src++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9206
			len--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9207
		    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9208
		    p++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9209
		}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9210
	    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9211
	    GlobalUnlock(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9212
	    CloseClipboard();
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
  9213
	    DDPRINTF(("WinWorkstation [info]: clipBoard data is <%s>\n", (char *)hData));
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9214
	    RETURN(s);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9215
	}
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9216
    }
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9217
%}.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9218
    ^ nil
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9219
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9220
    "Created: / 09-10-2007 / 12:46:00 / cg"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9221
!
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9222
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9223
getUnicodeClipboardData
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9224
    "get the contents of the windows clipboard.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9225
     Answer a string on success or nil otherwise.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9226
     Caveat: for now, only Text is supported"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9227
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9228
%{
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9229
    HANDLE hData;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9230
    OBJ s;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9231
    unsigned char *src, *p;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9232
    WIDECHAR *w_src, *w_p;
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9233
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9234
    /* Unicode */
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9235
    if (IsClipboardFormatAvailable(CF_UNICODETEXT)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9236
	int nRemain, len, realLen;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9237
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  9238
	if (OpenClipboard(NULL)) {
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9239
	    int needUnicode = 0;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9240
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9241
	    hData = GetClipboardData(CF_UNICODETEXT);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9242
	    w_src = GlobalLock(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9243
	    len = w_src ? wcslen(w_src) : 0;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9244
	    /*
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9245
	     * 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
  9246
	     * and if result is really Unicode ...
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9247
	     */
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9248
	    for (realLen=nRemain=len, w_p=w_src; nRemain; ) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9249
		WIDECHAR w_ch;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9250
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9251
		w_ch = *w_p++; nRemain--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9252
		if ((unsigned) w_ch > 0xFF) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9253
		    needUnicode = 1;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9254
		}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9255
		if (w_ch == 0x0D) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9256
		    if (nRemain && (*w_p == 0x0A)) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9257
			w_p++; nRemain--;realLen--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9258
		    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9259
		}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9260
	    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9261
	    if (! needUnicode) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9262
		s = __MKEMPTYSTRING(realLen);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9263
		if (s != nil) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9264
		    for (p = __stringVal(s); len; ) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9265
			unsigned char ch;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9266
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9267
			*p = ch = *w_src++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9268
			len--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9269
			if (len && (ch == 0x0D) && (*w_src == 0x0A)) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9270
			    *p = 0x0A;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9271
			    w_src++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9272
			    len--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9273
			}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9274
			p++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9275
		    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9276
		}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9277
	    } else {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9278
		s = __BYTEARRAY_NEW_INT(realLen * 2);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9279
		if (s != nil) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  9280
		    __objPtr(s)->o_class = @global(Unicode16String);
4811
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9281
		    for (w_p = (WIDECHAR *)__stringVal(s); len; ) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9282
			WIDECHAR w_ch;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9283
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9284
			*w_p = w_ch = *w_src++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9285
			len--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9286
			if (len && (w_ch == 0x0D) && (*w_src == 0x0A)) {
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9287
			    *w_p = 0x0A;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9288
			    w_src++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9289
			    len--;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9290
			}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9291
			w_p++;
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9292
		    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9293
		}
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9294
	    }
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9295
	    GlobalUnlock(hData);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9296
	    CloseClipboard();
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9297
	    RETURN(s);
9b04f5e8a01b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4810
diff changeset
  9298
	}
4802
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9299
    }
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9300
%}.
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9301
    ^ nil
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9302
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9303
    "Created: / 09-10-2007 / 12:45:26 / cg"
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9304
!
bec2c03cc782 preps for image-clipboard
Claus Gittinger <cg@exept.de>
parents: 4792
diff changeset
  9305
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9306
setClipboardData:aString
4748
fbbc9a20d88e Fix clipboard handling when Smalltalk objects are in the clipboard
Stefan Vogel <sv@exept.de>
parents: 4745
diff changeset
  9307
    "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
  9308
     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
  9309
     Caveat: for now, only Text is supported."
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9310
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9311
%{
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9312
    HANDLE hData;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9313
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
  9314
    if (__isStringLike(aString)) {
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9315
	char *s, *p, *src, *dst;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9316
	int n, len, realLen;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9317
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  9318
	if (OpenClipboard(NULL)) {
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9319
	    s = __stringVal(aString);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9320
	    /* must replace CR by CRLF */
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9321
	    len = realLen = __stringSize(aString);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9322
	    for (src=s, n=len; n; n--) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9323
		if ((src[0] == 0x0A) && ((src == s) || (src[-1] != 0x0D))) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9324
		    realLen++;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9325
		}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9326
		src++;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9327
	    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9328
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9329
	    hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, realLen+1);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9330
	    if (hData) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9331
		char *t = GlobalLock(hData);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9332
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9333
		if (t) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9334
		    for (src=s, dst=t, n=len; n;) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9335
			unsigned char ch;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9336
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9337
			ch = src[0]; n--;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9338
			if ((ch == 0x0A) && ((src == s) || (src[-1] != 0x0D))) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9339
			    *dst++ = 0x0D;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9340
			    *dst++ = 0x0A;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9341
			} else {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9342
			    *dst++ = ch;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9343
			}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9344
			src++;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9345
		    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9346
		    *dst = 0;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9347
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9348
		    EmptyClipboard();
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9349
		    if (SetClipboardData(CF_TEXT, hData) != 0) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9350
			/* Note: After setting clipboard data,
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9351
			 * the memory block previously allocated belongs to
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9352
			 * the clipboard - not to the app.
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9353
			 */
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9354
			CloseClipboard();
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9355
			RETURN (true);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9356
		    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9357
		    DPRINTF(("SetClipboardData error:%d\n", GetLastError()));
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9358
		    GlobalUnlock(hData);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9359
		}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9360
	    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9361
	    CloseClipboard();
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9362
	}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9363
	RETURN(false);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9364
    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9365
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9366
    /* Unicode */
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9367
    if (__isWords(aString)) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9368
	WIDECHAR *w_s, *w_p, *w_src, *w_dst;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9369
	int n, len, realLen;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9370
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  9371
	if (OpenClipboard(NULL)) {
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9372
	    OBJ cls;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9373
	    int nInstBytes;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9374
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9375
	    cls = __qClass(aString);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9376
	    nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9377
	    w_s = (WIDECHAR *)(__stringVal(aString) + nInstBytes);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9378
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9379
	    /* must replace CR by CRLF */
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9380
	    len = realLen = (__byteArraySize(aString) - nInstBytes) / 2;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9381
	    for (w_src=w_s, n=len; n; n--) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9382
		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
  9383
		    realLen++;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9384
		}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9385
		w_src++;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9386
	    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9387
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9388
	    hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, (realLen+1)*sizeof(WIDECHAR));
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9389
	    if (hData) {
6067
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
  9390
		WIDECHAR *t = GlobalLock(hData);
4281
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9391
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9392
		if (t) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9393
		    for (w_src=w_s, w_dst=t, n=len; n;) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9394
			WIDECHAR w_ch;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9395
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9396
			w_ch = w_src[0]; n--;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9397
			if ((w_ch == 0x0A) && ((w_src == w_s) || (w_src[-1] != 0x0D))) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9398
			    *w_dst++ = 0x0D;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9399
			    *w_dst++ = 0x0A;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9400
			} else {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9401
			    *w_dst++ = w_ch;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9402
			}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9403
			w_src++;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9404
		    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9405
		    *w_dst = 0;
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9406
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9407
		    EmptyClipboard();
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9408
		    if (SetClipboardData(CF_UNICODETEXT, hData) != 0) {
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9409
			/* Note: After setting clipboard data,
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9410
			 * the memory block previously allocated belongs to
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9411
			 * the clipboard - not to the app.
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9412
			 */
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9413
			CloseClipboard();
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9414
			RETURN (true);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9415
		    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9416
		    DPRINTF(("SetClipboardData error:%d\n", GetLastError()));
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9417
		    GlobalUnlock(hData);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9418
		}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9419
	    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9420
	    CloseClipboard();
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9421
	}
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9422
	RETURN(false);
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9423
    }
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9424
%}.
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9425
    self primitiveFailed.
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9426
! !
e22c313e9ff8 category changes
Stefan Vogel <sv@exept.de>
parents: 4280
diff changeset
  9427
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9428
!WinWorkstation methodsFor:'color stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9429
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9430
colorRed:redVal green:greenVal blue:blueVal
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9431
    "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
  9432
     This method is obsoleted by #colorScaledRed:scaledGreen:scaledBlue:"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9433
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9434
    |r g b|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9435
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9436
    r := self percentToDeviceColorValue:redVal.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9437
    g := self percentToDeviceColorValue:greenVal.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9438
    b := self percentToDeviceColorValue:blueVal.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9439
    ^ self colorScaledRed:r scaledGreen:g scaledBlue:b
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9440
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9441
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9442
colorScaledRed:r scaledGreen:g scaledBlue:b
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9443
    "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
  9444
     (i.e. colorID)"
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9445
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9446
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9447
    int id, ir, ig, ib;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9448
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  9449
    if (__bothSmallInteger(r, g) && __isSmallInteger(b)) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
  9450
	id = RGB2st(__intVal(r),__intVal(g),__intVal(b));
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
  9451
	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
  9452
	RETURN ( __MKSMALLINT(id) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9453
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9454
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9455
    self primitiveFailed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9456
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9457
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9458
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9459
freeColor:colorIndex
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  9460
    "free a display color when its no longer needed.
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
  9461
     A dummy here, since RGB colors are never freed."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9462
4074
b40ae99d0f76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4059
diff changeset
  9463
    "/ 'free color' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9464
    ^ self
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9465
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9466
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9467
getRGBFrom:index into:aBlock
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9468
    "get rgb components (0..100) of color in map at:index,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9469
     and evaluate the 3-arg block, aBlock with them"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9470
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9471
    |val|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9472
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9473
    self getScaledRGBFrom:index into:[:r :g :b |
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  9474
	val := aBlock
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  9475
		value:(r * 100.0 / 16rFFFF)
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  9476
		value:(g * 100.0 / 16rFFFF)
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
  9477
		value:(b * 100.0 / 16rFFFF)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9478
    ].
4074
b40ae99d0f76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4059
diff changeset
  9479
    "/ 'get RGB' printCR.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9480
    ^ val
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9481
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9482
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9483
getRGBFromName:colorName into:aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9484
    "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
  9485
     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
  9486
     Return nil for unknown color names."
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9487
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9488
    |val|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9489
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9490
    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
  9491
	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
  9492
	val := aBlock
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
  9493
		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
  9494
		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
  9495
		value:(b * 100.0 / 16rFFFF)
5338
e447c6b3ed77 colorName:ifIllegal: - did return black for illegal color,
Claus Gittinger <cg@exept.de>
parents: 5335
diff changeset
  9496
    ].
e447c6b3ed77 colorName:ifIllegal: - did return black for illegal color,
Claus Gittinger <cg@exept.de>
parents: 5335
diff changeset
  9497
    ^ val
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9498
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9499
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9500
getScaledRGBFrom:index into:aBlock
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9501
    "get rgb components (0 .. 16rFFFF) of color in map at:index,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9502
     and evaluate the 3-arg block, aBlock with them"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9503
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9504
    |r g b|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9505
%{
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9506
    int id = __intVal(index);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9507
    int iR, iG, iB;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9508
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9509
    id = st2RGB(id,0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9510
    iR = id & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9511
    iG = (id >> 8) & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9512
    iB = (id >> 16) & 0xFF;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9513
    iR = (iR << 8) | iR;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9514
    iG = (iG << 8) | iG;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9515
    iB = (iB << 8) | iB;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9516
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9517
    r = __MKSMALLINT(iR);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9518
    g = __MKSMALLINT(iG);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9519
    b = __MKSMALLINT(iB);
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
  9520
    /*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
  9521
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9522
    ^ aBlock value:r value:g value:b
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9523
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9524
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9525
getScaledRGBFromName:colorName into:aBlock
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9526
    "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
  9527
     and evaluate the 3-arg block, aBlock with them.
7677
e79cf02d0d4a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 7614
diff changeset
  9528
     Return nil for unknown color names or invalid hex numbers."
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9529
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
  9530
    |triple r g b found cName|
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9531
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9532
    r := g := b := 0.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9533
    found := false.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9534
    (colorName startsWith:$#) ifTrue:[
7680
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9535
	"/ color in r/g/b hex notation
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9536
	colorName size == 7 ifTrue:[
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9537
	    r := Integer readFrom:(colorName copyFrom:2 to:3) radix:16 onError:[nil].
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9538
	    g := Integer readFrom:(colorName copyFrom:4 to:5) radix:16 onError:[nil].
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9539
	    b := Integer readFrom:(colorName copyFrom:6 to:7) radix:16 onError:[nil].
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9540
	].
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9541
	(r isNil or:[g isNil or:[b isNil]]) ifTrue:[^ nil].
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9542
	found := true.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9543
    ] ifFalse:[
7680
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9544
	cName := colorName asString.
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9545
	triple := StandardColorValues at:cName ifAbsent:nil.
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9546
	triple isNil ifTrue:[
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9547
	    "/ try lowercase name
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9548
	    cName := cName asLowercase.
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9549
	    triple := StandardColorValues at:cName ifAbsent:nil.
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9550
	    triple isNil ifTrue:[
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9551
		"/ try lowercase without intermixed spaces
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9552
		cName := cName asCollectionOfWords asStringWith:nil.
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9553
		triple := StandardColorValues at:cName ifAbsent:nil.
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9554
	    ].
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9555
	].
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9556
	triple notNil ifTrue:[
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9557
	    r := triple at:1.
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9558
	    g := triple at:2.
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9559
	    b := triple at:3.
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9560
	    found := true.
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9561
	].
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9562
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9563
    found ifFalse:[
7680
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9564
	"/ ('WinWorkstation: unknown color: ' , colorName) infoPrintCR.
6597c1842893 increased the number of cached GDI resources
Claus Gittinger <cg@exept.de>
parents: 7677
diff changeset
  9565
	^ nil.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9566
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9567
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9568
    ^ aBlock value:((r * 256) + r) value:((g * 256) + g) value:((b * 256) + b)
7677
e79cf02d0d4a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 7614
diff changeset
  9569
e79cf02d0d4a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 7614
diff changeset
  9570
    "Modified (comment): / 14-11-2016 / 14:02:11 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9571
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9572
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9573
listOfAvailableColors
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9574
    "return a list of all available colornames.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9575
     This should not be used, since colornames are very
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9576
     display-specific (here X-specific)."
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9577
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9578
    |aStream list line index colorName|
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9579
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9580
    aStream := FileStream readonlyFileNamed:'/usr/lib/X11/rgb.txt'.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9581
    aStream isNil ifTrue:[^ nil].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9582
    list := OrderedCollection new.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9583
    [aStream atEnd] whileFalse:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9584
	line := aStream nextLine.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9585
	line notNil ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9586
	    "skip the r/g/b numbers"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9587
	    index := 1.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9588
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9589
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9590
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9591
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9592
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9593
	    [(line at:index) isDigit] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9594
	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9595
	    colorName := line copyFrom:index.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9596
	    ((colorName occurrencesOf:(Character space)) == 0) ifTrue:[
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9597
		list add:colorName
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9598
	    ]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9599
	]
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9600
    ].
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9601
    aStream close.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9602
    ^ list sort
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9603
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9604
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9605
     Screen current listOfAvailableColors
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9606
    "
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9607
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9608
    "Modified: 11.9.1996 / 15:26:28 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9609
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9610
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9611
percentToDeviceColorValue:aPercentage
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9612
    "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
  9613
     WIN-component value (0..16rFFFF) as an integer"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9614
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9615
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9616
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9617
    if (__isSmallInteger(aPercentage)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9618
	RETURN ( __MKSMALLINT(0xFFFF * __intVal(aPercentage) / 100) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9619
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9620
    if (__isFloat(aPercentage)) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
  9621
	RETURN ( __MKSMALLINT(0xFFFF * (INT)(__floatVal(aPercentage)) / 100) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9622
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9623
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9624
    ^ (16rFFFF * aPercentage / 100) rounded
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9625
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9626
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9627
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
  9628
    "change a palette index.
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9629
     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
  9630
     - 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
  9631
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9632
     '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
  9633
     ^ self.
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9634
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9635
    "Created: 30.1.1998 / 09:27:48 / md"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9636
    "Modified: 30.1.1998 / 09:30:22 / md"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9637
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9638
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9639
!WinWorkstation methodsFor:'cursor stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9640
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9641
builtInCursorShapes
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9642
    "return a collection of standard cursor names.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9643
     Those are built into Windows and need not be created as
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9644
     user cursors.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9645
     (actually, there are more than those below ...)"
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9646
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9647
    "/ if you add something here, also add to #shapeNumberFromCursor ...
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9648
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9649
    ^ #(
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9650
	#upLeftArrow            "/ IDC_ARROW
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9651
	#upDownArrow            "/ IDC_SIZENS
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9652
	#leftRightArrow         "/ IDC_SIZEWE
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9653
	#text                   "/ IDC_IBEAM
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9654
	#wait                   "/ IDC_WAIT
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9655
	#execute                "/ IDC_APPSTARTING
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9656
	#crossHair              "/ IDC_CROSS
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9657
	#fourWay                "/ IDC_SIZEALL
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9658
	#upRightHand            "/ IDC_ARROW
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9659
	#noDrop                 "/ IDC_NO
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9660
	#stop                   "/ IDC_NO
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
  9661
       )
3110
0058dbbb19df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3109
diff changeset
  9662
0058dbbb19df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3109
diff changeset
  9663
    "Modified: / 10.12.1999 / 15:16:26 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9664
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9665
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9666
createCursorShape:aShape
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9667
    "create a cursor given a shape-symbol"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9668
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9669
    |number|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9670
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9671
    number := self shapeNumberFromSymbol:aShape.
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9672
    number isNil ifTrue:[^ nil].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9673
    ^ self primCreateCursorShapeNr:number
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9674
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9675
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9676
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
  9677
    "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
  9678
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9679
    |padding bpl bplPadded srcOffs dstOffs
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9680
     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
  9681
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  9682
    cW := self getSystemMetrics:#SM_CXCURSOR.
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  9683
    cH := self getSystemMetrics:#SM_CYCURSOR.
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
  9684
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9685
    "/ ('cursorWidth ',cW printString,'cursorHeight ',cH printString) infoPrintCR.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9686
    src := sourceBytes.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9687
    mask := maskBytes.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9688
    padding := self cursorBitmapPadding.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9689
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9690
    "/ repadding and/or resizing required ?
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9691
    bpl := sourceBytes size / h.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9692
    bplPadded := (cW + padding - 1) // padding * 2.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9693
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9694
    bpl ~~ bplPadded ifTrue:[
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9695
	 "/     'repad cursor bits' infoPrintCR.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9696
	srcPadded := ByteArray new:(bplPadded * cH).
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9697
	nB := bpl min: bplPadded.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9698
	nR := cH min: h.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9699
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9700
	dstOffs := srcOffs := 1.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9701
	1 to:nR do:[:row |
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9702
	    srcPadded
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9703
		replaceFrom:dstOffs
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9704
		to:(dstOffs+nB-1)
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9705
		with:src
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9706
		startingAt:srcOffs.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9707
	    dstOffs := dstOffs + bplPadded.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9708
	    srcOffs := srcOffs + bpl.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9709
	].
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9710
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9711
	maskPadded := ByteArray new:(bplPadded * cH).
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9712
	dstOffs := srcOffs := 1.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9713
	1 to:nR do:[:row |
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9714
	    maskPadded
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9715
		replaceFrom:dstOffs
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9716
		to:(dstOffs+nB-1)
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9717
		with:mask
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9718
		startingAt:srcOffs.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9719
	    dstOffs := dstOffs + bplPadded.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9720
	    srcOffs := srcOffs + bpl.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9721
	].
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9722
	src := srcPadded.
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9723
	mask := maskPadded.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9724
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9725
    ].
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9726
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9727
    src invert.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9728
    1 to:src size do:[:index |
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9729
	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
  9730
    ].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9731
    mask invert.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9732
    cursor := self
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9733
	primCreateCursorSourceBits:src
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9734
	maskBits:mask
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9735
	hotX:hx hotY:hy
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
  9736
	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
  9737
    cursor notNil ifTrue:[^ cursor ].
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9738
    'WinWorkstation [warning]: could not create bitmap cursor' infoPrintCR.
4575
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  9739
e082b3fa71c8 dual screen (virtual extent) fix.
Claus Gittinger <cg@exept.de>
parents: 4539
diff changeset
  9740
    "Modified: / 08-09-2006 / 15:39:42 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9741
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9742
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9743
cursorBitmapPadding
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9744
    ^ 16 "/ windows requires short-padded rows
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9745
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9746
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9747
destroyCursor:aCursorId
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9748
    "destroy a cursor"
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9749
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9750
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9751
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9752
    if (ISCONNECTED) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9753
	if (__isExternalAddress(aCursorId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9754
	    HCURSOR curs = _HCURSORVal(aCursorId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9755
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9756
	    if (curs) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9757
#ifdef KEEP_STD_CURSORS
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9758
		if ((curs != H_C_ARROW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9759
		 && (curs != H_C_CROSS)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9760
		 && (curs != H_C_IBEAM)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9761
		 && (curs != H_C_ICON)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9762
		 && (curs != H_C_NO)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9763
		 && (curs != H_C_SIZE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9764
		 && (curs != H_C_SIZEALL)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9765
		 && (curs != H_C_SIZENESW)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9766
		 && (curs != H_C_SIZENS)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9767
		 && (curs != H_C_SIZENWSE)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9768
		 && (curs != H_C_UPARROW)
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9769
		 && (curs != H_C_APPSTARTING)
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9770
		 && (curs != H_C_WAIT))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9771
#endif /* KEEP_STD_CURSORS */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9772
		{
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9773
		    DestroyCursor(curs);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9774
#ifdef COUNT_RESOURCES
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9775
		    __cnt_cur--;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9776
		    RESPRINTF(("DestroyCursor %d\n",__cnt_cur));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9777
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9778
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9779
	    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9780
	    RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9781
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9782
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9783
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9784
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9785
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9786
needDeviceFormsForCursor
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9787
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9788
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9789
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9790
primCreateCursorShapeNr:number
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9791
    " create a standard (shape) cursor"
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9792
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
  9793
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9794
    HCURSOR newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9795
    LPCTSTR cId;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9796
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9797
    if (__isSmallInteger(number)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9798
	cId = (LPCTSTR)(__intVal(number));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9799
	newCursor = LoadCursor(NULL, cId);
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
  9800
	if (newCursor) {
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
  9801
#ifdef KEEP_STD_CURSORS
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9802
	    if (cId == IDC_ARROW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9803
		H_C_ARROW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9804
	    else if (cId == IDC_CROSS)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9805
		H_C_CROSS = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9806
	    else if (cId == IDC_IBEAM)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9807
		H_C_IBEAM = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9808
	    else if (cId == IDC_ICON)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9809
		H_C_ICON = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9810
	    else if (cId == IDC_NO)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9811
		H_C_NO = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9812
	    else if (cId == IDC_SIZE)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9813
		H_C_SIZE = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9814
	    else if (cId == IDC_SIZEALL)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9815
		H_C_SIZEALL = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9816
	    else if (cId == IDC_SIZENESW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9817
		H_C_SIZENESW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9818
	    else if (cId == IDC_SIZENS)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9819
		H_C_SIZENS = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9820
	    else if (cId == IDC_SIZENWSE)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9821
		H_C_SIZENWSE = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9822
	    else if (cId == IDC_UPARROW)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9823
		H_C_UPARROW = newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9824
	    else if (cId == IDC_WAIT)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9825
		H_C_WAIT = newCursor;
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9826
	    else if (cId == IDC_APPSTARTING)
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9827
		H_C_APPSTARTING = newCursor;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9828
#endif /* KEEP_STD_CURSORS */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9829
	    RETURN ( __MKOBJ(newCursor) );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9830
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9831
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9832
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9833
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9834
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9835
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9836
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
  9837
    "create a cursor from given pixels"
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
  9838
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9839
%{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9840
    HCURSOR newCursor;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9841
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9842
    if (__isByteArray(src)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9843
     && __isByteArray(mask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9844
     && __bothSmallInteger(hx, hy)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9845
     && __bothSmallInteger(w, h)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9846
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9847
	newCursor = CreateCursor((HANDLE) __getHInstance(),
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9848
				 __intVal(hx), __intVal(hy),
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9849
				 __intVal(w), __intVal(h),
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9850
				 __ByteArrayInstPtr(mask)->ba_element,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9851
				 __ByteArrayInstPtr(src)->ba_element);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9852
	if (newCursor) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9853
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9854
	    __cnt_cur++;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9855
	    RESPRINTF(("CreateCursor %d\n",__cnt_cur));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9856
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9857
	    RETURN ( __MKOBJ(newCursor));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9858
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9859
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9860
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9861
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9862
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9863
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9864
shapeNumberFromSymbol:shape
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9865
    "given a shape-symbol, return the corresponding cursor-number,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9866
     or nil if no such standard cursor exists."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9867
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9868
    "this is pure Win-knowlegde - but you may easily add more"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9869
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9870
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9871
    if (shape == @symbol(upRightHand)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9872
	RETURN ( __MKSMALLINT( (INT)IDC_ARROW));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
  9873
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9874
    if (shape == @symbol(upLeftArrow)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9875
	RETURN ( __MKSMALLINT( (INT)IDC_ARROW));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9876
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9877
    if (shape == @symbol(upDownArrow)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9878
	RETURN ( __MKSMALLINT( (INT)IDC_SIZENS));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9879
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9880
    if (shape == @symbol(leftRightArrow)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9881
	RETURN ( __MKSMALLINT( (INT)IDC_SIZEWE));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9882
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9883
    if (shape == @symbol(text)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9884
	RETURN ( __MKSMALLINT( (INT)IDC_IBEAM));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9885
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9886
    if (shape == @symbol(wait)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9887
	RETURN ( __MKSMALLINT( (INT)IDC_WAIT));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9888
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9889
    if (shape == @symbol(crossHair)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9890
	RETURN ( __MKSMALLINT( (INT)IDC_CROSS));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9891
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9892
    if (shape == @symbol(fourWay)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9893
	RETURN ( __MKSMALLINT( (INT)IDC_SIZEALL));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9894
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9895
    if (shape == @symbol(execute)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9896
	RETURN ( __MKSMALLINT( (INT)IDC_APPSTARTING));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9897
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
  9898
    if (shape == @symbol(noDrop)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9899
	RETURN ( __MKSMALLINT( (INT)IDC_NO));
3110
0058dbbb19df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3109
diff changeset
  9900
    }
0058dbbb19df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3109
diff changeset
  9901
    if (shape == @symbol(stop)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9902
	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
  9903
    }
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9904
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9905
    if (shape == @symbol(IDC_UPARROW)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9906
	RETURN ( __MKSMALLINT( (INT)IDC_UPARROW));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9907
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9908
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9909
    if (shape == @symbol(IDC_SIZE)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9910
	RETURN ( __MKSMALLINT( (INT)IDC_SIZE));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9911
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9912
    if (shape == @symbol(IDC_SIZENWSE)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9913
	RETURN ( __MKSMALLINT( (INT)IDC_SIZENWSE));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9914
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9915
    if (shape == @symbol(IDC_SIZENESW)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9916
	RETURN ( __MKSMALLINT( (INT)IDC_SIZENESW));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9917
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9918
    if (shape == @symbol(IDC_NO)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9919
	RETURN ( __MKSMALLINT( (INT)IDC_NO));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9920
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9921
#ifdef IDC_HELP
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9922
    if (shape == @symbol(IDC_HELP)) {
3117
837ce31d08ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3110
diff changeset
  9923
	RETURN ( __MKSMALLINT( (INT)IDC_HELP));
2364
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9924
    }
50a217088763 more standard cursors.
Claus Gittinger <cg@exept.de>
parents: 2348
diff changeset
  9925
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9926
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9927
"/    ('WINWORKSTATION: invalid cursorShape:' , shape printString) infoPrintNL.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9928
    ^  nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9929
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9930
4461
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9931
!WinWorkstation methodsFor:'drag & drop'!
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9932
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9933
dragFinish:dropHandle
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9934
    "free Win32 data (and remove the drop-file)"
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9935
%{
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9936
    if (__isExternalAddress(dropHandle)) {
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  9937
	HDROP hDrop = (HDROP)__externalAddressVal(dropHandle);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  9938
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  9939
	__externalAddressVal(dropHandle) = 0;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  9940
	if (hDrop) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  9941
	    DragFinish(hDrop);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
  9942
	}
4461
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9943
    }
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9944
%}
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9945
! !
adecf2db552f drag and drop
Claus Gittinger <cg@exept.de>
parents: 4457
diff changeset
  9946
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9947
!WinWorkstation methodsFor:'drawing'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
  9948
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9949
copyFromId:sourceId x:srcX y:srcY gc:srcGCId to:destId x:dstX y:dstY gc:dstGCId
6361
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9950
		width:w height:h
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9951
    "do a bit-blt; copy bits from the rectangle defined by
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9952
     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
  9953
     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
  9954
     argument is not integer."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9955
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
  9956
%{
2264
817f27555776 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2260
diff changeset
  9957
    struct gcData *dstGcData = 0;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9958
    struct gcData *srcGcData = 0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9959
    HDC srcDC = (HDC)0;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9960
    HDC dstDC = (HDC)0;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9961
    int     dstGcOwnerThreadID;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9962
    HWND    dstGcHWIN;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9963
    HBITMAP dstGcHBITMAP;
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9964
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9965
    if (! __isExternalAddress(srcGCId)
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9966
     || ! __isExternalAddress(dstGCId)) {
6361
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9967
	goto fail;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
  9968
    }
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9969
    srcGcData = _GCDATA(srcGCId);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9970
    dstGcData = _GCDATA(dstGCId);
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9971
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
  9972
    if (__bothSmallInteger(w, h)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
  9973
     && __bothSmallInteger(srcX, srcY)
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9974
     && __bothSmallInteger(dstX, dstY)
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9975
     && srcGcData
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
  9976
     && dstGcData) {
6361
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9977
	int fun = BITBLT_COPY;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9978
	int src_fg, src_bg, dst_fg, dst_bg;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9979
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9980
	fun = dstGcData->bitbltrop2;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9981
#if 0
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9982
	switch (fun) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9983
	  case BITBLT_COPY:
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9984
	    console_printf("BITBLT_COPY\n");
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9985
	    break;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9986
	  case BITBLT_COPYINVERTED:
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9987
	    console_printf("BITBLT_COPYINVERTED\n");
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9988
	    break;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9989
	  case BITBLT_XOR:
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9990
	    console_printf("BITBLT_XOR\n");
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9991
	    break;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9992
	  case BITBLT_AND:
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9993
	    console_printf("BITBLT_AND\n");
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9994
	    break;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9995
	  case BITBLT_OR:
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9996
	    console_printf("BITBLT_OR\n");
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9997
	    break;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9998
	}
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
  9999
#endif
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10000
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10001
	/*
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10002
	 * a scroll operation ?
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10003
	 */
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10004
	if (srcGcData->hWnd
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10005
	 && ((srcGcData->hWnd == dstGcData->hWnd)
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10006
	 && (fun == BITBLT_COPY))) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10007
	    RECT rec, updRect;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10008
	    RECT invRec;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10009
	    HRGN updRgn = 0, dstRgn = 0, nUpdRgn = 0;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10010
	    int _srcX = __intVal(srcX);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10011
	    int _srcY = __intVal(srcY);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10012
	    int _dstX = __intVal(dstX);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10013
	    int _dstY = __intVal(dstY);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10014
	    int _w = __intVal(w);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10015
	    int _h = __intVal(h);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10016
	    int noExpose = 0;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10017
	    int _deltaX, _deltaY;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10018
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10019
#ifdef CACHE_LAST_DC
6361
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10020
	    if (lastGcData) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10021
		_releaseDC(lastGcData);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10022
	    }
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10023
#endif
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10024
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10025
	    rec.left = _srcX;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10026
	    rec.top  = _srcY;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10027
	    rec.right = rec.left + _w;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10028
	    rec.bottom = rec.top + _h;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10029
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10030
	    _deltaX = _dstX - _srcX;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10031
	    _deltaY = _dstY - _srcY;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10032
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10033
	    DDPRINTF(("dst and src is HWND %x fun == BITBLT_COPY --> scroll %d/%d\n",
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10034
		    srcGcData->hWnd,
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10035
		    _deltaX,
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10036
		    _deltaY));
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10037
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10038
	    if ((_deltaX == 0) && (_deltaY == 0)) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10039
		noExpose = 1;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10040
	    } else {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10041
		updRgn = CreateRectRgn(0, 0, 0, 0);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10042
		ScrollWindowEx(srcGcData->hWnd,
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10043
			    _deltaX,
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10044
			    _deltaY,
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10045
			    &rec,            /* area to scroll */
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10046
			    0,               /* clip region */
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10047
			    updRgn,
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10048
			    NULL, /* &invRec, */
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10049
			    0 /* SW_ERASE | SW_INVALIDATE */);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10050
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10051
		/*
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10052
		 * we are not interested in the source-area;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10053
		 * only care for exposed areas in the dst area.
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10054
		 */
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10055
		dstRgn = CreateRectRgn(_dstX, _dstY, _dstX+_w, _dstY+_h);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10056
		nUpdRgn = CreateRectRgn(0, 0, 0, 0);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10057
		switch (CombineRgn(nUpdRgn, updRgn, dstRgn, RGN_AND)) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10058
		    case ERROR:
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10059
			_DeleteObject(nUpdRgn, __LINE__);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10060
			nUpdRgn = updRgn;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10061
			noExpose = 1;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10062
			break;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10063
		    case NULLREGION:
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10064
			noExpose = 1;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10065
			break;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10066
		    default:
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10067
			if (__generateExposes(srcGcData->hWnd, nUpdRgn, __WM_GEXPOSE, 1) <= 0) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10068
			    noExpose = 1;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10069
			}
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10070
			break;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10071
		}
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10072
	    }
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10073
	    if (noExpose) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10074
		/*
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10075
		 * no exposes generated - must send a NOEXPOSE
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10076
		 */
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10077
		enqEvent(ExposureMask, srcGcData->hWnd, __WM_NOGEXPOSE, 0, 0, 0, 0, 0, EV_NOTIME);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10078
	    }
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10079
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10080
	    if (dstRgn) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10081
		_DeleteObject(dstRgn, __LINE__);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10082
	    }
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10083
	    if (nUpdRgn && (nUpdRgn != updRgn)) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10084
		_DeleteObject(nUpdRgn, __LINE__);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10085
	    }
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10086
	    if (updRgn) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10087
		_DeleteObject(updRgn, __LINE__);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10088
	    }
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10089
	    RETURN ( self );
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10090
	}
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10091
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10092
	fun = dstGcData->bitbltrop2;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10093
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10094
	if (0 /* fun == BITBLT_COPY */) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10095
	    src_fg = dst_fg = 0xFFFFFF;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10096
	    src_bg = dst_bg = 0x000000;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10097
	} else {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10098
	    src_fg = srcGcData->fgColor;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10099
	    src_bg = srcGcData->bgColor;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10100
	    dst_fg = dstGcData->fgColor;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10101
	    dst_bg = dstGcData->bgColor;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10102
	}
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10103
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10104
	/*
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10105
	 * a simple copy (like scroll, but in a bitmap) ?
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10106
	 */
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10107
	if ((srcGcData == dstGcData)
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10108
	 && (fun == BITBLT_COPY)) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10109
	    RECT rec, uprec;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10110
	    int _srcX, _srcY;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10111
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10112
	    rec.left = _srcX = __intVal(srcX);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10113
	    rec.top = _srcY = __intVal(srcY);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10114
	    rec.right = rec.left + __intVal(w);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10115
	    rec.bottom = rec.top + __intVal(h);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10116
	    srcDC = _getDC(srcGcData);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10117
	    SetBkColor(srcDC, src_fg);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10118
	    SetTextColor(srcDC, src_bg);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10119
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10120
	    DDPRINTF(("dst and src is DC %x fun == BITBLT_COPY  --> scrolling %d %d\n",srcDC,__intVal(dstX) - __intVal(srcX),__intVal(dstY) - __intVal(srcY)));
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10121
	    ScrollDC(srcDC, __intVal(dstX)-_srcX,
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10122
			    __intVal(dstY)-_srcY,
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10123
			    &rec, 0, 0, &uprec);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10124
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10125
	    SetBkColor(srcDC, srcGcData->bgColor);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10126
	    SetTextColor(srcDC, srcGcData->fgColor);
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10127
#ifndef CACHE_LAST_DC
6361
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10128
	    _releaseDC(srcGcData);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10129
#endif
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10130
	    RETURN ( self );
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10131
	}
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 10132
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 10133
#ifdef xxCACHE_LAST_DC
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 10134
/* mhmh - this should not be needed */
6361
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10135
	if (lastGcData) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10136
	    _releaseDC(lastGcData);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10137
	}
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10138
#endif
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10139
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10140
	if (dstGcData == srcGcData) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10141
	    srcDC = dstDC = _getDC(dstGcData);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10142
	} else {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10143
	    srcDC = _getDC(srcGcData);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10144
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10145
	    /*
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10146
	     * kludge - pretent nothing is cached for a moment,
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10147
	     * to avoid release in getDC below ...
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10148
	     */
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10149
#ifdef CACHE_LAST_DC
6361
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10150
	    dstGcOwnerThreadID = lastGcOwnerThreadID;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10151
	    dstGcHWIN = lastGcHWIN;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10152
	    dstGcHBITMAP = lastGcHBITMAP;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10153
	    lastGcData = 0;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10154
#endif
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10155
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10156
	    dstDC = _getDC(dstGcData);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10157
	    SetBkColor(dstDC, dst_fg);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10158
	    SetTextColor(dstDC, dst_bg);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10159
	}
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10160
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10161
	SetBkColor(srcDC, src_fg);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10162
	SetTextColor(srcDC, src_bg);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10163
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10164
	CPRINTF(("bitblt src f:%x b:%x",GetTextColor(srcDC),GetBkColor(srcDC)));
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10165
	CPRINTF(("dst f:%x b:%x\n",GetTextColor(dstDC),GetBkColor(dstDC)));
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10166
	if (BitBlt(dstDC,
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10167
	     __intVal(dstX), __intVal(dstY),
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10168
	     __intVal(w), __intVal(h),
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10169
	     srcDC,
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10170
	     __intVal(srcX), __intVal(srcY),
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10171
	     fun)
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10172
	   == 0
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10173
	  ) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10174
	    console_fprintf(stderr, "WinWorkstation [info]: ERROR in BitBlt: %d\n", GetLastError());
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10175
	}
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10176
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10177
	if (dstGcData != srcGcData) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10178
	    SetBkColor(dstDC, dstGcData->bgColor);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10179
	    SetTextColor(dstDC, dstGcData->fgColor);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10180
	}
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10181
	SetBkColor(srcDC, srcGcData->bgColor);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10182
	SetTextColor(srcDC, srcGcData->fgColor);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10183
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10184
	if (srcGcData != dstGcData) {
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10185
	    _releaseDC(srcGcData);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10186
	}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10187
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10188
#ifdef CACHE_LAST_DC
6361
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10189
	/*
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10190
	 * kludge again - restore last-DC cache
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10191
	 */
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10192
	lastGcData = dstGcData;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10193
	lastGcOwnerThreadID = dstGcOwnerThreadID;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10194
	lastGcHWIN = dstGcHWIN;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10195
	lastGcHBITMAP = dstGcHBITMAP;
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10196
#else
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10197
	_releaseDC(dstGcData);
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10198
#endif
d75c1259ce78 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6358
diff changeset
 10199
	RETURN ( self );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10200
    }
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
 10201
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 10202
 fail: ;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10203
%}.
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10204
    self primitiveFailed.
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10205
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10206
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10207
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10208
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
 10209
		width:w height:h
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10210
    "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
 10211
     copy bits from the rectangle defined by
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10212
     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
 10213
     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
 10214
     argument is not integer."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10215
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10216
    ^ self
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10217
	copyFromId:sourceId
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10218
		 x:srcX y:srcY gc:srcDCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10219
		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
 10220
	     width:w height:h
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10221
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10222
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10223
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
 10224
    "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
 10225
     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
 10226
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10227
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10228
    int __x, __y, w, h;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10229
    float angle1, angle2;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10230
    double f;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10231
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10232
    if (__isSmallInteger(startAngle))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10233
	angle1 = (float)(__intVal(startAngle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10234
    else if (__isFloat(startAngle)) {
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10235
	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
 10236
    } else if (__isShortFloat(startAngle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
 10237
	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
 10238
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10239
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10240
    if (__isSmallInteger(angle))
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10241
	angle2 = (float)(__intVal(angle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10242
    else if (__isFloat(angle)) {
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10243
	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
 10244
    } else if (__isShortFloat(angle)) {
2297
3443e454a52d preps for clipboard support (not yet finished)
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
 10245
	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
 10246
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10247
2930
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10248
    if (angle2 <= 0) {
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10249
	RETURN (self);
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10250
    }
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10251
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10252
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10253
     && __bothSmallInteger(x, y)
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 10254
     && __bothSmallInteger(width, height))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10255
     {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10256
	struct gcData *gcData = _GCDATA(aGCId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10257
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 10258
	POINT p;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10259
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10260
	w = __intVal(width);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10261
	h = __intVal(height);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10262
	__x = __intVal(x);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10263
	__y = __intVal(y);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10264
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10265
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10266
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10267
	if (! GcDataGetPen(hDC, gcData)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10268
	    DPRINTF(("displayArc: no pen\n"));
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10269
	} else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10270
	    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
 10271
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10272
	    xR = w / 2;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10273
	    yR = h / 2;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10274
	    if (angle2 - angle1 >= 360) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10275
		xB = xE = __x + xR + 0.5;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10276
		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
 10277
	    } else {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10278
		double sin(), cos();
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10279
		float rad1, rad2;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10280
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10281
		if (angle1 <= 180)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10282
		  angle1 = 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10283
		else
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10284
		  angle1 = 360 + 180 - angle1;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10285
		angle2 = angle1 - angle2;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10286
		/* sigh - compute the intersections ... */
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10287
		rad1 = (angle1 * 3.14159265359) / 180.0;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10288
		rad2 = (angle2 * 3.14159265359) / 180.0;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10289
		xB = cos(rad1) * xR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10290
		yB = sin(rad1) * yR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10291
		xE = cos(rad2) * xR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10292
		yE = sin(rad2) * yR;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10293
		xB = __x + xR - xB + 0.5;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10294
		yB = __y + yR - yB + 0.5;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10295
		xE = __x + xR - xE + 0.5;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 10296
		yE = __y + yR - yE + 0.5;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10297
	    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10298
	    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
 10299
	    Arc(hDC,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10300
		__x, __y,
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10301
		__x + w, __y + h,
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10302
		(int)xB, (int)yB,
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10303
		(int)xE, (int)yE);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10304
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10305
	    GcDataReleasePen(hDC, gcData);
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10306
	}
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10307
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10308
	_releaseDC(gcData);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10309
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10310
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10311
    }
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10312
    bad: ;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10313
%}.
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10314
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10315
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10316
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10317
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
 10318
    "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
 10319
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10320
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10321
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10322
     && __bothSmallInteger(x0, y0)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10323
     && __bothSmallInteger(x1, y1)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10324
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10325
	int __x1 = __intVal(x1), __y1 = __intVal(y1);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10326
	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
 10327
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10328
/*      DPRINTF(("displayLine: %d/%d -> %d/%d\n",
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10329
		    __intVal(x0), __intVal(y0),
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10330
		    __x1, __y1));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10331
*/
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10332
	if (! GcDataGetPen(hDC, gcData)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10333
	    DPRINTF(("displayLine: no pen\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10334
	} else {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10335
	    MoveToEx(hDC, __intVal(x0), __intVal(y0), NULL);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10336
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10337
	    LineTo(hDC, __x1, __y1);
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 10338
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10339
	    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10340
	     * end-point ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10341
	     */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10342
	    LineTo(hDC, __x1+1, __y1);
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 10343
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10344
	    GcDataReleasePen(hDC, gcData);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10345
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10346
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10347
	_releaseDC(gcData);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10348
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10349
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10350
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10351
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10352
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10353
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10354
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
 10355
    "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
 10356
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10357
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10358
    if (__isExternalAddress(aGCId)
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 10359
     && __bothSmallInteger(px, py)) {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10360
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10361
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 10362
	POINT p;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10363
	int __x = __intVal(px), __y = __intVal(py);
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 10364
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 10365
#ifdef OLD
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10366
	int savedLStyle = gcData->lStyle;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10367
	int savedLWidth = gcData->lineWidth;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10368
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10369
	/*
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10370
	 * 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
 10371
	 */
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10372
	if ((gcData->lStyle != PS_SOLID)
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10373
	 || (gcData->lineWidth > 1)) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10374
	    FLUSH_CACHED_DC(gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10375
	    gcData->lStyle = PS_SOLID;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10376
	    gcData->lineWidth = 0;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10377
	}
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 10378
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10379
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10380
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10381
	if (! GcDataGetPen(hDC,gcData)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10382
	    DPRINTF(("displayPoint: no pen\n"));
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 10383
	} else {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10384
	    MoveToEx(hDC, __x, __y, NULL);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10385
	    /*
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10386
	     * end-point ...
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10387
	     */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10388
	    LineTo(hDC, __x+1, __y);
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10389
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10390
	    GcDataReleasePen(hDC, gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10391
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10392
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10393
# ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10394
	_releaseDC(gcData);
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10395
# endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10396
	if ((gcData->lStyle != savedLStyle)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10397
	 || (gcData->lineWidth != savedLWidth)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10398
	    FLUSH_CACHED_DC(gcData);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10399
	    gcData->lStyle = savedLStyle;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10400
	    gcData->lineWidth = savedLWidth;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10401
	}
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 10402
#else /* NEW */
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 10403
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10404
	hDC = _getDC(gcData);
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 10405
	SetPixelV(hDC, __x, __y, gcData->fgColor);
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10406
# ifndef CACHE_LAST_DC
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10407
	_releaseDC(gcData);
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 10408
# endif
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 10409
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 10410
#endif /* NEW */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10411
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10412
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10413
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10414
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10415
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10416
displayPolygon:aPolygon in:ignoredDrawableId with:aGCId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10417
    "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
 10418
     which define the polygon.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10419
     If any coordinate is not integer, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10420
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10421
    |numberOfPoints|
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10422
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10423
    numberOfPoints := aPolygon size.
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10424
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10425
%{
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10426
    OBJ point, px, py;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10427
    int i, num;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10428
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10429
    if (__isExternalAddress(aGCId)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10430
     && __isSmallInteger(numberOfPoints)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10431
	struct gcData *gcData = _GCDATA(aGCId);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10432
	HDC hDC = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10433
	POINT p;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10435
	num = __intVal(numberOfPoints);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10436
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10437
	for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10438
	    point = __AT_(aPolygon, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10439
	    if (! __isPoint(point)) goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10440
	    px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10441
	    py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10442
	    if (! __bothSmallInteger(px, py)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10443
		goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10444
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10445
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10446
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10447
	hDC = _getDC(gcData);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10448
	if (! GcDataGetPen(hDC,gcData)) {
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10449
	    DPRINTF(("displayPolygon: no pen\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10450
	} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10451
	    for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10452
		point = __AT_(aPolygon, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10453
		px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10454
		py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10455
		p.x = __intVal(px);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10456
		p.y = __intVal(py);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10457
		if (i == 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10458
		    MoveToEx(hDC, p.x, p.y, NULL);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10459
		} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10460
		    if (i == (num-1)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10461
			PolylineTo(hDC, &p, 1);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10462
		    } else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10463
			LineTo(hDC, p.x, p.y);
4181
91439783248a bugfix: display polygon PRE_04_JUN_04
ca
parents: 4161
diff changeset
 10464
#ifdef PRE_04_JUN_04
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10465
			/*
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10466
			 * end-point ...
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10467
			 */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10468
			LineTo(hDC, p.x+1, p.y);
4181
91439783248a bugfix: display polygon PRE_04_JUN_04
ca
parents: 4161
diff changeset
 10469
#endif
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10470
		    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10471
		}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10472
	    }
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10473
	    GcDataReleasePen(hDC, gcData);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10474
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10475
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10476
#ifndef CACHE_LAST_DC
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10477
	_releaseDC(gcData);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10478
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10479
	RETURN ( self );
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10480
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10481
fail: ;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10482
%}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10483
!
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10484
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10485
displayPolylines:aPolyline in:ignoredDrawableId with:aGCId
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10486
    "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
 10487
     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
 10488
     If any coordinate is not integer, an error is triggered."
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10489
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10490
    |numberOfPoints|
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10491
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10492
    numberOfPoints := aPolyline size.
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10493
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10494
%{
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10495
    OBJ point, px, py;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10496
    int i, num;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10497
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10498
    if (__isExternalAddress(aGCId)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10499
     && __isSmallInteger(numberOfPoints)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10500
	struct gcData *gcData = _GCDATA(aGCId);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10501
	HDC hDC = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10502
	POINT p;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10503
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10504
	num = __intVal(numberOfPoints);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10505
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10506
	for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10507
	    point = __AT_(aPolyline, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10508
	    if (! __isPoint(point)) goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10509
	    px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10510
	    py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10511
	    if (! __bothSmallInteger(px, py)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10512
		goto fail;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10513
	    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10514
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10515
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10516
	hDC = _getDC(gcData);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10517
	if (! GcDataGetPen(hDC,gcData)) {
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10518
	    DPRINTF(("displayPolygon: no pen\n"));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10519
	} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10520
	    for (i=0; i<num; i++) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10521
		point = __AT_(aPolyline, __MKSMALLINT(i+1));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10522
		px = _point_X(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10523
		py = _point_Y(point);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10524
		p.x = __intVal(px);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10525
		p.y = __intVal(py);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10526
		if ((i & 1) == 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10527
		    MoveToEx(hDC, p.x, p.y, NULL);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10528
		} else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10529
		    LineTo(hDC, p.x, p.y);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10530
		    /*
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10531
		     * end-point ...
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10532
		     */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10533
		    LineTo(hDC, p.x+1, p.y);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10534
		}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10535
	    }
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10536
	    GcDataReleasePen(hDC, gcData);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10537
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10538
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10539
#ifndef CACHE_LAST_DC
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10540
	_releaseDC(gcData);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10541
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10542
	RETURN ( self );
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10543
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10544
fail: ;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 10545
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10546
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10547
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10548
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
 10549
    "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
 10550
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
 10551
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10552
    int w, h;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10553
    int xL, yT;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10554
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10555
     && __bothSmallInteger(x, y)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10556
     && __bothSmallInteger(width, height)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10557
	struct gcData *gcData = _GCDATA(aGCId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10558
	HDC hDC = _getDC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10559
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10560
	xL = __intVal(x);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10561
	yT = __intVal(y);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10562
	w = __intVal(width);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10563
	h = __intVal(height);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10564
6165
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
 10565
	DDDDPRINTF(("displayRectangle: %d/%d -> %d/%d\n",
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10566
			xL, yT, w, h));
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 10567
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10568
	if ((w >= 0) && (h >= 0)) {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 10569
	    if (! GcDataGetPen(hDC,gcData)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10570
		DPRINTF(("displayRect: no pen\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10571
	    } else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10572
		MoveToEx(hDC, xL, yT, NULL);
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10573
#if 0
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10574
		LineTo(hDC, xL+w, yT);     // to top-right
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10575
		LineTo(hDC, xL+w, yT+h);   // to bot-right
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10576
		LineTo(hDC, xL, yT+h);     // to bot-left
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10577
		LineTo(hDC, xL, yT);       // back to top-left
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10578
#else
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10579
		LineTo(hDC, xL+w, yT);       // to top-right
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10580
		LineTo(hDC, xL+w, yT+h);     // to bot-right
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10581
		MoveToEx(hDC, xL, yT, NULL); // back to top-left
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10582
		LineTo(hDC, xL, yT+h);       // to bot-left
3976
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10583
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10584
#ifndef PRE_31_JAN_03
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10585
		LineTo(hDC, xL+w+1, yT+h);   // move pen one pixel more
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10586
#else
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10587
		LineTo(hDC, xL+w, yT+h);     // to bot-right
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 10588
#endif
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10589
3976
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10590
#endif
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10591
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10592
		GcDataReleasePen(hDC, gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10593
	    }
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10594
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10595
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10596
	_releaseDC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10597
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10598
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10599
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10600
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10601
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10602
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10603
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
 10604
    "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
 10605
     foreground and background characters.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10606
     If the coordinates are not integers, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10607
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
 10608
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10609
    unsigned char *cp;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10610
    OBJ cls;
5342
516a8f20d81d Use TextOutA to write one-byte-strings.
Stefan Vogel <sv@exept.de>
parents: 5338
diff changeset
 10611
    int i1, i2, l, n;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10612
    int nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10613
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10614
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10615
     && __isNonNilObject(aString)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10616
     && __bothSmallInteger(index1, index2)
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 10617
     && __bothSmallInteger(x, y))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10618
    {
6486
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10619
	struct gcData *gcData;
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10620
	int pX, pY;
6486
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10621
	HDC hDC;
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10622
	HFONT hOldFont;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10623
6486
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10624
	i1 = __intVal(index1) - 1;
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10625
	i2 = __intVal(index2) - 1;
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10626
	if ((i1 < 0) || (i2 < i1)) {
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10627
	    RETURN (self);
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10628
	}
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10629
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10630
	gcData = _GCDATA(aGCId);
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10631
	hDC = _getDC(gcData);
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10632
	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
 10633
	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
 10634
	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
 10635
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10636
	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
 10637
	    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
 10638
		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
 10639
		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
 10640
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10641
	} else {
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10642
	    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
 10643
		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
 10644
		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
 10645
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10646
	}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10647
#if 0
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10648
	/* 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
 10649
	 * 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
 10650
	 */
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10651
	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
 10652
	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
 10653
	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
 10654
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10655
#if 0
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10656
	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
 10657
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10658
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10659
	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
 10660
6486
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10661
	cp = __stringVal(aString);
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10662
	l = i2 - i1 + 1;
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10663
	if (l > 32758) {
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10664
	    /* Windows (as in XP) limits the string size for TextOut* to 32758 */
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10665
	    l = 32758;
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10666
	}
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10667
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10668
	if (__isStringLike(aString)) {
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10669
	    n = __stringSize(aString);
5342
516a8f20d81d Use TextOutA to write one-byte-strings.
Stefan Vogel <sv@exept.de>
parents: 5338
diff changeset
 10670
commonOutChars:
6486
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10671
	    if (i2 < n) {
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10672
		cp += i1;
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10673
		CPRINTF(("string1: %s pos=%d/%d l=%d hDC=%x\n", cp, pX, pY,l,hDC));
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10674
		if (! TextOutA(hDC, pX, pY, (char *)cp, l)) {
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10675
		    PRINTF(("WinWorkstation [warning]: TextOutA failed. [%d]\n", __LINE__));
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10676
		    PRINTF(("WinWorkstation [warning]: lastError=%d x:%d y:%d len:%d\n", GetLastError(), pX, pY, l));
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10677
		    goto error;
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10678
		}
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10679
	    }
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10680
	    goto ret;
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10681
	}
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10682
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10683
	nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10684
	cp += nInstBytes;
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10685
	n = __byteArraySize(aString) - nInstBytes;
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10686
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10687
	if (__isBytes(aString)) {
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10688
	    goto commonOutChars;
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10689
	}
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10690
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10691
	/* Unicode */
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10692
	if (__isWords(aString)) {
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10693
	    n = n / 2;
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10694
	    if (i2 < n) {
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10695
		WIDECHAR *w_cp = (WIDECHAR *)cp;
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10696
		w_cp += i1;
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10697
		if (! TextOutW(hDC, pX, pY, w_cp, l)) {
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10698
		    PRINTF(("WinWorkstation [warning]: TextOutW failed. [%d]\n", __LINE__));
4bd177a046f1 dont attempt to draw strings with zero size
Claus Gittinger <cg@exept.de>
parents: 6376
diff changeset
 10699
		    PRINTF(("WinWorkstation [warning]: lastError=%d x:%d y:%d len:%d\n", GetLastError(), pX, pY, l));
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10700
		}
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10701
		goto ret;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10702
	    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10703
	}
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 10704
ret:;
4941
f9fae1143962 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4939
diff changeset
 10705
#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
 10706
	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
 10707
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10708
#if 0
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10709
	SelectObject(hDC, hOldFont);
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 10710
#endif
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 10711
#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
 10712
	_releaseDC(gcData);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10713
#endif
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10714
    }
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10715
    RETURN (self);
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10716
error: ;;
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 10717
%}.
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 10718
    self textOutFailed.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10719
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10720
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10721
drawBits:imageBits
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10722
    bitsPerPixel:bitsPerPixel
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10723
    depth:imageDepth padding:padd
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10724
    width:imageWidth height:imageHeight
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10725
    x:srcx y:srcy
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10726
    into:ignoredDrawableId
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10727
    x:dstx y:dsty
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10728
    width:w height:h
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10729
    with:aGCId
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10730
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10731
    "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
 10732
     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
 10733
     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
 10734
     depth and pixel-units to be different (in theory).
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10735
     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
 10736
     depth - otherwise, primitive failure will be signalled.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10737
     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
 10738
     colors are allocated - otherwise the colors may be wrong."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10739
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 10740
    (self
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10741
	primDrawBits:imageBits
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10742
	bitsPerPixel:bitsPerPixel
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10743
	depth:imageDepth
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10744
	width:imageWidth height:imageHeight
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10745
	x:srcx y:srcy
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10746
	into:ignoredDrawableId
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10747
	x:dstx y:dsty
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10748
	width:w height:h
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10749
	with:aGCId
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10750
	parameters:(Array with:nil with:padd with:nil with:nil with:nil)
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10751
	"/ 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
 10752
    ) ifFalse:[
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10753
	"
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10754
	 also happens, if a segmentation violation occurs in primitive code...
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10755
	"
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10756
	self primitiveFailed
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10757
    ].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10758
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10759
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10760
drawBits:imageBits
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10761
    bitsPerPixel:bitsPerPixel
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10762
    depth:imageDepth
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10763
    width:imageWidth height:imageHeight
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10764
    x:srcx y:srcy
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10765
    into:ignoredDrawableId
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10766
    x:dstx y:dsty
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10767
    width:w height:h
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10768
    with:aGCId
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10769
    parameters:parameters
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10770
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10771
    "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
 10772
     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
 10773
     Individual source pixels have bitsPerPixel bits, allowing to draw
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10774
     depth and pixel-units to be different (in theory).
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10775
     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
 10776
     depth - otherwise, primitive failure will be signalled.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10777
     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
 10778
     colors are allocated - otherwise the colors may be wrong."
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10779
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10780
    (self
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10781
	primDrawBits:imageBits
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10782
	bitsPerPixel:bitsPerPixel
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10783
	depth:imageDepth
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10784
	width:imageWidth height:imageHeight
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10785
	x:srcx y:srcy
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10786
	into:ignoredDrawableId
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10787
	x:dstx y:dsty
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10788
	width:w height:h
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10789
	with:aGCId
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10790
	parameters:parameters
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10791
	"/ 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
 10792
    ) ifFalse:[
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10793
	"
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10794
	 also happens, if a segmentation violation occurs in primitive code...
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10795
	"
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 10796
	self primitiveFailed
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10797
    ].
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10798
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 10799
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10800
fillArcX:x y:y width:width height:height from:startAngle angle:angle
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10801
	       in:ignoredDrawableId with:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10802
    "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
 10803
     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
 10804
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10805
%{
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10806
    int __x, __y, w, h;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10807
    float angle1, angle2;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10808
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10809
    if (__isSmallInteger(startAngle))
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10810
	angle1 = (float)(__intVal(startAngle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10811
    else if (__isFloat(startAngle)) {
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10812
	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
 10813
    } else if (__isShortFloat(startAngle)) {
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10814
	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
 10815
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10816
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10817
    if (__isSmallInteger(angle))
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10818
	angle2 = (float)(__intVal(angle));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10819
    else if (__isFloat(angle)) {
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10820
	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
 10821
    } else if (__isShortFloat(angle)) {
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10822
	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
 10823
    } else goto bad;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10824
2930
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10825
    if (angle2 <= 0) {
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10826
	RETURN (self);
2930
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10827
    }
6b6db22e2259 arc with 0-angle
Claus Gittinger <cg@exept.de>
parents: 2929
diff changeset
 10828
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10829
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10830
     && __bothSmallInteger(x, y)
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 10831
     && __bothSmallInteger(width, height))
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10832
     {
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10833
	struct gcData *gcData = _GCDATA(aGCId);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10834
	HDC hDC;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10835
	HBRUSH hBrush;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10836
	HPEN prevPen = 0;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10837
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10838
	w = __intVal(width);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10839
	h = __intVal(height);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10840
	__x = __intVal(x);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10841
	__y = __intVal(y);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10842
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10843
	hDC = _getDC(gcData);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10844
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10845
	hBrush = GcDataGetBrush(hDC, gcData);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10846
	if (hBrush == 0) {
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10847
	    DPRINTF(("fillArc: no brush\n"));
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10848
	} else {
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10849
	    HPEN hPen = 0;
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 10850
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 10851
#if 0
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10852
	    hPen = GcDataGetPen(hDC, gcData);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10853
	    if (hPen == 0) {
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10854
		DPRINTF(("fillArc: no pen\n"));
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10855
		goto failpen;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10856
	    }
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10857
#else
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10858
	    prevPen = SelectObject(hDC, __nullPen);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10859
	    w++;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10860
	    h++;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10861
#endif
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10862
	    {
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10863
		double xB, yB, xE, yE, xR, yR;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10864
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10865
		xR = w / 2;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10866
		yR = h / 2;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10867
		if (angle2 - angle1 >= 360) {
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10868
		    xB = xE = __x + xR + 0.5;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10869
		    yB = yE = __y /*+ yR + 0.5*/;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10870
		} else {
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10871
		    double sin(), cos();
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10872
		    float rad1, rad2;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10873
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10874
		    if (angle1 <= 180)
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10875
			angle1 = 180 - angle1;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10876
		    else
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10877
			angle1 = 360 + 180 - angle1;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10878
		    angle2 = angle1 - angle2;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10879
		    /* sigh - compute the intersections ... */
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10880
		    rad1 = (angle1 * 3.14159265359) / 180.0;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10881
		    rad2 = (angle2 * 3.14159265359) / 180.0;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10882
		    xB = cos(rad1) * xR;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10883
		    yB = sin(rad1) * yR;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10884
		    xE = cos(rad2) * xR;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10885
		    yE = sin(rad2) * yR;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10886
		    xB = __x + xR - xB + 0.5;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10887
		    yB = __y + yR - yB + 0.5;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10888
		    xE = __x + xR - xE + 0.5;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10889
		    yE = __y + yR - yE + 0.5;
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10890
		}
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10891
		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));
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10892
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10893
		Pie(hDC,
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10894
		    __x, __y,
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10895
		    __x + w + 1, __y + h + 1,
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10896
		    (int)xB, (int)yB,
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10897
		    (int)xE, (int)yE);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10898
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10899
		if (hPen) {
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10900
		    GcDataReleasePen(hDC, gcData);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10901
		}
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10902
	    }
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10903
failpen:
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10904
#ifdef CACHE_LAST_CG
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10905
	    if (prevPen) SelectObject(hDC, prevPen);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10906
#endif
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10907
	    GcDataReleaseBrush(hDC, gcData);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10908
	}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10909
#ifndef CACHE_LAST_DC
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10910
	_releaseDC(gcData);
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10911
#endif
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 10912
	RETURN ( self );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10913
    }
2270
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10914
    bad: ;
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10915
%}.
b58aa9d04cfe oops - passed right/bottom instead of width/height to expose event
Claus Gittinger <cg@exept.de>
parents: 2264
diff changeset
 10916
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10917
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10918
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10919
fillPolygon:aPolygon in:ignoredDrawableId with:aGCId
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10920
    "fill a polygon given by its points.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10921
     If any coordinate is not integer, an error is triggered."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10922
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10923
    |numberOfPoints|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10924
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 10925
    numberOfPoints := aPolygon size.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10926
    self
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 10927
	primFillPolygon:aPolygon n:numberOfPoints
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10928
	in:ignoredDrawableId with:aGCId
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10929
!
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10930
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 10931
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
 10932
    "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
 10933
2642
2178ebc9756a code cleanup
Claus Gittinger <cg@exept.de>
parents: 2641
diff changeset
 10934
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10935
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10936
    int w, h;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10937
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10938
     && __bothSmallInteger(x, y)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10939
     && __bothSmallInteger(width, height)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10940
	w = __intVal(width);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10941
	h = __intVal(height);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10942
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 10943
	if ((w >= 0) && (h >= 0)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10944
	    struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10945
	    HDC hDC;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10946
	    HBRUSH hBrush;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10947
	    RECT rct;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 10948
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10949
	    hDC = _getDC(gcData);
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 10950
2663
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
 10951
	    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
 10952
	    if (! hBrush) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10953
		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
 10954
	    } else {
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10955
		rct.left = __intVal(x);
3976
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10956
		rct.top  = __intVal(y);
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10957
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10958
#ifndef PRE_31_JAN_03
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10959
		rct.right  = rct.left + w;
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10960
		rct.bottom = rct.top  + h;
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10961
#else
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10962
		rct.right  = rct.left + w + 1;    /* definitiv ! */
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10963
		rct.bottom = rct.top  + h + 1;
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10964
#endif
2538
75869b009af5 code cleanup;
Claus Gittinger <cg@exept.de>
parents: 2511
diff changeset
 10965
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 10966
		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
 10967
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 10968
		/*
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 10969
		 * for solid draws (without function), can use FillRect,
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 10970
		 * which is faster and does not need a pen.
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 10971
		 */
2663
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
 10972
		if ((gcData->rop2 == R2_COPYPEN)
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
 10973
		 && (gcData->bitbltrop2 == BITBLT_COPY)) {
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 10974
		    AQUIRE_DRAW_MUTEX
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 10975
		    FillRect(hDC, &rct, hBrush);
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 10976
		    RELEASE_DRAW_MUTEX
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 10977
		    GcDataReleaseBrush(hDC, gcData);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 10978
		} else {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10979
		    HPEN prevPen;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10980
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10981
		    prevPen = SelectObject(hDC, __nullPen);
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
 10982
/* sigh - conflict between ST/X's Rectangle and Win32's Rectangle */
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
 10983
# undef Rectangle
3976
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10984
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10985
#ifndef PRE_31_JAN_03
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10986
		    Rectangle(hDC, rct.left, rct.top, rct.right +1, rct.bottom +1);
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10987
#else
2663
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
 10988
		    Rectangle(hDC, rct.left, rct.top, rct.right, rct.bottom);
3976
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10989
#endif
e4fc7d7c2a42 bugfix: filling rectangle
ca
parents: 3973
diff changeset
 10990
3969
b1f257b4dd7c menu font from system settings
ca
parents: 3963
diff changeset
 10991
# define Rectangle __DEF_Rectangle
2663
b03c1fdd073c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2661
diff changeset
 10992
		    GcDataReleaseBrush(hDC, gcData);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10993
#ifdef CACHE_LAST_DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10994
		    SelectObject(hDC, prevPen);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 10995
#endif
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 10996
		}
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10997
	    }
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 10998
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 10999
	    _releaseDC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 11000
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11001
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11002
	RETURN ( self );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11003
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11004
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11005
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11006
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11007
primDrawBits:imageBits
8023
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11008
    bitsPerPixel:bitsPerPixel
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11009
    depth:imageDepth msb:msb
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11010
    masks:maskVector
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11011
    padding:padd
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11012
    extent:imageExtent
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11013
    sourceOrigin:srcOrigin
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11014
    into:ignoredDrawableId
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11015
    destinationOrigin:dstOrigin
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11016
    extent:imageExtent2
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11017
    with:aGCId
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11018
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11019
    (self
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11020
	primDrawBits:imageBits
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11021
	bitsPerPixel:bitsPerPixel
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11022
	depth:imageDepth
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11023
	width:imageExtent x height:imageExtent y
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11024
	x:srcOrigin x y:srcOrigin y
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11025
	into:ignoredDrawableId
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11026
	x:dstOrigin x y:dstOrigin y
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11027
	width:imageExtent x height:imageExtent y
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11028
	with:aGCId
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11029
	parameters:(Array with:nil with:padd with:(maskVector at:1) with:(maskVector at:2) with:(maskVector at:3))
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11030
	"/ the params array is ONLY used, because there is a 15-argument limit in st/x !!
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11031
	"/   sourceAlphaOrNil := params at:1.
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11032
	"/   padd := params at:2.
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11033
	"/   redMask := params at:3.
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11034
	"/   greenMask := params at:4.
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11035
	"/   blueMask := params at:5.
8023
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11036
    ) ifFalse:[
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11037
	"
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11038
	 also happens, if a segmentation violation occurs in primitive code...
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11039
	"
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11040
	self primitiveFailed
8023
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11041
    ].
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11042
!
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11043
649871e9ad69 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 8015
diff changeset
 11044
primDrawBits:imageBits
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11045
	bitsPerPixel:bitsPerPixel depth:imageDepth
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11046
	width:imageWidth height:imageHeight
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11047
	x:srcx y:srcy
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11048
	into:ignoredDrawableId
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11049
	x:dstx y:dsty
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11050
	width:w height:h
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11051
	with:aGCId
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11052
	parameters:params
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11053
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11054
    |sourceAlphaOrNil padd redMask greenMask blueMask|
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11055
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11056
    "/ 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
 11057
    sourceAlphaOrNil := params at:1.
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11058
    padd := params at:2.
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11059
    redMask := params at:3.
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11060
    greenMask := params at:4.
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11061
    blueMask := params at:5.
8011
6fb515551297 #BUGFIX by expecco
Claus Gittinger <cg@exept.de>
parents: 7991
diff changeset
 11062
6fb515551297 #BUGFIX by expecco
Claus Gittinger <cg@exept.de>
parents: 7991
diff changeset
 11063
%{  /* STACK: 20000 */
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11064
    unsigned char fastBits[10000];
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11065
    unsigned char *b_bits = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11066
    unsigned char *allocatedBits = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11067
    struct gcData *gcData = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11068
    HDC hDC = (HDC)0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11069
    unsigned char *__imageBits = 0;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11070
    int _sourceAlpha = 0;
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11071
    int _doAlphaBlend = 0;
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11072
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11073
    if (__isByteArray(imageBits)) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11074
	__imageBits = __ByteArrayInstPtr(imageBits)->ba_element;
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11075
    } else if (__isExternalBytesLike(imageBits)) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11076
	__imageBits = (unsigned char *)(__externalBytesAddress(imageBits));
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11077
    }
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11078
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11079
    if (ISCONNECTED
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11080
     && __isExternalAddress(aGCId)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11081
     && __bothSmallInteger(srcx, srcy)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11082
     && __bothSmallInteger(dstx, dsty)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11083
     && __bothSmallInteger(w, h)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11084
     && __bothSmallInteger(imageWidth, imageHeight)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11085
     && __bothSmallInteger(imageDepth, bitsPerPixel)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11086
     && __isSmallInteger(padd)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11087
     && __imageBits)
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11088
     {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11089
	struct
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11090
	{
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11091
	  BITMAPINFOHEADER bmiHeader;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11092
	  DWORD r;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11093
	  DWORD g;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11094
	  DWORD b;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11095
	  DWORD a;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11096
	} bitmap;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11097
	int _padd = __intVal(padd);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11098
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11099
	gcData = _GCDATA(aGCId);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11100
	if (! gcData )
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11101
	    goto fail;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11102
	hDC = _getDC(gcData);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11103
	DDDDPRINTF(("hDC = %x\n", hDC));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11104
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11105
	if (_padd != WIN32PADDING) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11106
	    int row, col;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11107
	    unsigned char *cp;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11108
	    unsigned char *pBits;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11109
	    int b_width, b_height, bytesPerRowST, bytesPerRowWIN, padding, nBytes;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11110
	    int bi = __intVal(bitsPerPixel);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11111
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11112
	    b_width = __intVal(imageWidth);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11113
	    b_height = __intVal(imageHeight);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11114
	    bytesPerRowST = (b_width * bi + (_padd-1)) / _padd;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11115
	    bytesPerRowWIN = (b_width * bi + (WIN32PADDING-1)) / WIN32PADDING * (WIN32PADDING/8);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11116
	    padding = bytesPerRowWIN - bytesPerRowST;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11117
	    /* console_printf("padd %d bs %d bw %d p %d\n",_padd,bytesPerRowST,bytesPerRowWN,padding); */
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11118
	    if (padding) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11119
		nBytes = b_height * bytesPerRowWIN;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11120
		if (nBytes < sizeof(fastBits)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11121
		    cp = b_bits = fastBits;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11122
		} else {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11123
		    cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11124
		}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11125
		if (cp) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11126
		    pBits = __imageBits;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11127
		    for (row = b_height; row; row--) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11128
			for (col = bytesPerRowST; col; col--) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11129
			    *cp++ = *pBits++;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11130
			}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11131
			cp += padding;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11132
		    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11133
		} else
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11134
		    goto fail;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11135
	    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11136
	}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11137
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11138
	if (b_bits == 0) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11139
	    b_bits = __imageBits;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11140
	}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11141
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11142
	bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11143
	bitmap.bmiHeader.biPlanes = 1;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11144
	switch (__intVal(imageDepth)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11145
	    case 16:
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11146
		// BI_BITFIELDS is only possible with 16 and 32 bit images
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11147
		// (see msdn.microoft.com/library/cc250415.aspx)
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11148
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11149
		// notice the default r/g/b (STX order here)
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11150
		bitmap.bmiHeader.biCompression = BI_BITFIELDS;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11151
		bitmap.r = redMask == nil ? 0xf800 : __intVal(redMask);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11152
		bitmap.g = greenMask == nil ? 0x07e0 : __intVal(greenMask);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11153
		bitmap.b = blueMask == nil ? 0x001f : __intVal(blueMask);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11154
		break;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11155
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11156
	    case 24:
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11157
		// BI_BITFIELDS is only possible with 16 and 32 bit images
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11158
		// (see msdn.microoft.com/library/cc250415.aspx)
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11159
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11160
		// notice the default b/g/r (WIN32 order here)
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11161
		bitmap.bmiHeader.biCompression = BI_RGB;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11162
		break;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11163
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11164
	    case 32:
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11165
		// BI_BITFIELDS is only possible with 16 and 32 bit images
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11166
		// (see msdn.microoft.com/library/cc250415.aspx)
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11167
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11168
		// notice the default r/g/b (STX order here)
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11169
		bitmap.bmiHeader.biCompression = BI_BITFIELDS;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11170
		bitmap.r = redMask == nil ? 0x0000ff : __intVal(redMask);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11171
		bitmap.g = greenMask == nil ? 0x00ff00 : __intVal(greenMask);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11172
		bitmap.b = blueMask == nil ? 0xff0000 : __intVal(blueMask);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11173
		bitmap.a = 0xff000000;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11174
		break;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11175
	}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11176
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11177
	if (sourceAlphaOrNil != nil) {
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11178
	    DPRINTF(("sourceAlphaOrNil = %x\n", sourceAlphaOrNil));
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11179
	    _sourceAlpha = __intVal(sourceAlphaOrNil);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11180
	    _doAlphaBlend = 1;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11181
	}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11182
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11183
	bitmap.bmiHeader.biSizeImage = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11184
	bitmap.bmiHeader.biXPelsPerMeter = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11185
	bitmap.bmiHeader.biYPelsPerMeter = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11186
	bitmap.bmiHeader.biClrUsed = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11187
	bitmap.bmiHeader.biClrImportant = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11188
	bitmap.bmiHeader.biWidth = __intVal(imageWidth);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11189
	bitmap.bmiHeader.biHeight = -(__intVal(imageHeight));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11190
	bitmap.bmiHeader.biBitCount = __intVal(bitsPerPixel);
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11191
	DPRINTF(("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));
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11192
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11193
	if (! _doAlphaBlend) {
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11194
	    // normal draw (no alpha)
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11195
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11196
	    SetDIBitsToDevice(hDC,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11197
				__intVal(dstx), __intVal(dsty),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11198
				__intVal(w), __intVal(h),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11199
				__intVal(srcx), __intVal(srcy),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11200
				0, __intVal(h),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11201
				(void *)b_bits,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11202
				(BITMAPINFO*)&bitmap,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11203
				DIB_RGB_COLORS);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11204
	} else {
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11205
	    // alpha blending
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11206
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11207
	    HDC ahdc;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11208
	    HBITMAP ahbitmap;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11209
	    void *pvBits;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11210
	    BLENDFUNCTION bf;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11211
	    static BOOL (__stdcall *P_AlphaBlend)(HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION );
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11212
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11213
	    if (P_AlphaBlend == 0) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11214
		/* as I don't have AlphaBlend in the inport32.lib (bcc sucks),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11215
		 * fetch its address dynamically...
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11216
		 */
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11217
		HINSTANCE hWinGDI = LoadLibrary("msimg32.dll");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11218
		if (hWinGDI) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11219
		    P_AlphaBlend = (BOOL (__stdcall *)(HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION ))
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11220
					GetProcAddress(hWinGDI, "AlphaBlend");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11221
		}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11222
	    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11223
	    if (P_AlphaBlend != 0) {
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11224
		DPRINTF(("***********************************\n"));
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11225
		DPRINTF(("_sourceAlpha = %d\n", _sourceAlpha));
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11226
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11227
		ahdc = CreateCompatibleDC(hDC);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11228
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11229
		ahbitmap = CreateCompatibleBitmap(hDC, __intVal(imageWidth), __intVal(imageHeight));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11230
		SelectObject(ahdc, ahbitmap);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11231
		SetDIBitsToDevice(ahdc,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11232
				0, 0,    /* dstx, dsty */
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11233
				__intVal(imageWidth), __intVal(imageHeight),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11234
				__intVal(srcx), __intVal(srcy),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11235
				0, __intVal(imageHeight),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11236
				(void *)b_bits,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11237
				(BITMAPINFO*)&bitmap,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11238
				DIB_RGB_COLORS);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11239
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11240
		bf.BlendOp = AC_SRC_OVER;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11241
		bf.BlendFlags = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11242
		bf.SourceConstantAlpha = _sourceAlpha;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11243
		bf.AlphaFormat = AC_SRC_ALPHA;
5317
90d5d8df3101 first attempts in alphablending support
Claus Gittinger <cg@exept.de>
parents: 5316
diff changeset
 11244
#if 1
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11245
		(*P_AlphaBlend) (hDC,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11246
				__intVal(dstx), __intVal(dsty),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11247
				__intVal(imageWidth), __intVal(imageHeight),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11248
				ahdc,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11249
				0, 0,     /* srcx, srcy */
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11250
				__intVal(imageWidth), __intVal(imageHeight),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11251
				bf);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11252
#else
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11253
		bf.SourceConstantAlpha = 255-_sourceAlpha;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11254
		bf.AlphaFormat = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11255
		bf.BlendOp = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11256
		(*P_AlphaBlend) (ahdc,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11257
				0, 0,     /* dstx, dsty */
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11258
				__intVal(imageWidth), __intVal(imageHeight),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11259
				hDC,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11260
				__intVal(dstx), __intVal(dsty),   /* srcx, srcy */
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11261
				__intVal(imageWidth), __intVal(imageHeight),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11262
				bf);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11263
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11264
		BitBlt (hDC,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11265
				__intVal(dstx), __intVal(dsty),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11266
				__intVal(imageWidth), __intVal(imageHeight),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11267
				ahdc,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11268
				0, 0,   /* srcx, srcy */
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11269
				SRCCOPY);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11270
#endif
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11271
		DeleteObject(ahbitmap);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11272
		DeleteDC(ahdc);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11273
	    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11274
	}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11275
	if (allocatedBits) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11276
	    free(allocatedBits);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11277
	}
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11278
#ifndef CACHE_LAST_DC
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11279
	_releaseDC(gcData);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11280
#endif
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11281
	RETURN ( true );
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11282
    }
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11283
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11284
fail: ;
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11285
    PRINTF(("create temp bitmap FAILED!!!\n"));
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11286
    if (allocatedBits) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11287
	PRINTF(("freeing up temp bitmap bits ...\n"));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11288
	free(allocatedBits);
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11289
    }
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11290
#ifndef CACHE_LAST_DC
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11291
    if (hDC) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 11292
	_releaseDC(gcData);
5316
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11293
    }
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11294
#endif
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11295
%}
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11296
.
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11297
    ^ false
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11298
!
f0dc2e0f0ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
 11299
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 11300
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
 11301
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 11302
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11303
    OBJ point, px, py;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11304
    int i, num;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11305
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11306
    if (__isExternalAddress(aGCId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11307
     && __isSmallInteger(numberOfPoints)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11308
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11309
	HDC hDC;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11310
	POINT p;
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 11311
	HBRUSH hBrush;
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11312
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11313
	num = __intVal(numberOfPoints);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11314
	if (num < 3) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11315
	    RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11316
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11317
	for (i=0; i<num; i++) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11318
	    point = __AT_(aPolygon, __MKSMALLINT(i+1));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11319
	    if (! __isPoint(point)) goto fail;
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11320
	    px = _point_X(point);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11321
	    py = _point_Y(point);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11322
	    if (! __bothSmallInteger(px, py))
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11323
		goto fail;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11324
	}
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11325
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11326
	hDC = _getDC(gcData);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11327
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 11328
	hBrush = GcDataGetBrush(hDC,gcData);
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 11329
	if (hBrush == 0) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11330
	    DPRINTF(("fillPolygon: no brush\n"));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11331
	} else {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11332
	    HPEN prevPen;
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11333
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11334
	    prevPen = SelectObject(hDC, __nullPen);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11335
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11336
	    BeginPath(hDC);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11337
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11338
	    for (i=0; i<num; i++) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11339
		point = __AT_(aPolygon, __MKSMALLINT(i+1));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11340
		px = _point_X(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11341
		py = _point_Y(point);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11342
		if (i == 0) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11343
		    MoveToEx(hDC, __intVal(px), __intVal(py), NULL);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11344
		} else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11345
		    if (i == (num-1)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11346
			p.x = __intVal(px);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11347
			p.y = __intVal(py);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11348
			PolylineTo(hDC, &p, 1);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11349
		    } else {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11350
			LineTo(hDC, __intVal(px), __intVal(py));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11351
		    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11352
		}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11353
	    }
1725
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11354
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11355
	    EndPath(hDC);
061ac79b48cf line drawing
Claus Gittinger <cg@exept.de>
parents: 1723
diff changeset
 11356
	    FillPath(hDC);
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 11357
	    GcDataReleaseBrush(hDC, gcData);
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11358
#ifdef CACHE_LAST_DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11359
	    SelectObject(hDC, prevPen);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 11360
#endif
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 11361
	}
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 11362
#ifndef CACHE_LAST_DC
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11363
	_releaseDC(gcData);
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 11364
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11365
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11366
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11367
fail: ;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11368
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11369
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11370
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11371
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11372
!WinWorkstation methodsFor:'event forwarding'!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11373
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11374
activate:aBoolean view:aView
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11375
    "some view was activated/deactivated.
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11376
     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
 11377
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11378
    aBoolean ifFalse:[
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11379
	activeView == aView ifTrue:[
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11380
	    activeView := nil.
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11381
	].
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11382
	self focusOutView:aView.
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11383
    ] ifTrue:[
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11384
	activeView := aView.
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 11385
	self focusInView:aView.
2598
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11386
    ].
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11387
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11388
    "Created: / 28.4.1999 / 14:51:51 / cg"
2599
9c0749ee47ed #activate:view: via sensor
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
 11389
    "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
 11390
!
648c300ed7c7 #activate:view: is only used in WinWorkstation (moved from DevWorkstat)
Claus Gittinger <cg@exept.de>
parents: 2597
diff changeset
 11391
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11392
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
 11393
    "forward a configure for some view"
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11394
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11395
    aView realized ifTrue:[
4578
4952db9d2081 maxExtent handling
Claus Gittinger <cg@exept.de>
parents: 4577
diff changeset
 11396
	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
 11397
    ]
4577
3df3646d702f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4576
diff changeset
 11398
3df3646d702f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4576
diff changeset
 11399
    "Modified: / 08-09-2006 / 19:40:18 / cg"
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11400
!
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 11401
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11402
copyDataEvent:parameter eventData:dataBytes view:aView
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11403
    "forward a copyData event for some view as a client message"
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11404
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11405
    aView isNil ifTrue:[
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11406
	"/ event arrived, after I destroyed it myself
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11407
	^ self
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11408
    ].
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11409
    aView sensor
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11410
	copyDataEvent:parameter
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11411
	eventData:dataBytes
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11412
	view:aView
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11413
!
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11414
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11415
displayChange
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11416
    "the display metrics/settings have changed.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11417
     This is a speciality of windows.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11418
     TODO: Tell the viewStyle to update itself,
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11419
	   and tell all views to reinit their style.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11420
     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
 11421
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11422
    self initializeVariableScreenProperties.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11423
!
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 11424
4457
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11425
dropFiles:files view:view position:dropPosition handle:dropHandle
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11426
    "called when files are dropped from windows.
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11427
     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
 11428
     eventually"
4455
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11429
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11430
"/    Transcript showCR:'Drop files:'.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11431
"/    Transcript show:'  View:'; showCR:view.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11432
"/    Transcript show:'  Position:'; showCR:dropPosition.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11433
"/    Transcript showCR:'  Files:'.
4457
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11434
"/    files do:[:f|
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11435
"/        Transcript showCR:('    ', f printString)
4455
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11436
"/    ].
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11437
"/
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11438
    view isNil ifTrue:[
4457
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11439
	"/ event arrived, after I destroyed it myself
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11440
	^ self
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11441
    ].
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11442
    view sensor
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11443
	dropFiles:files view:view position:dropPosition handle:dropHandle
4455
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11444
!
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 11445
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11446
fontChange
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11447
    "the system fonts (users preferences) have changed.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11448
     This is a speciality of windows.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11449
     TODO: Tell the viewStyle to update itself,
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 11450
	   and tell all views to reinit their style.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11451
     For now,this is ignored."
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11452
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11453
    IgnoreFontChanges ~~ true ifTrue:[
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 11454
"/        'WinWorkstation [info]: fontChange ignored for now.' infoPrintCR
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11455
    ]
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 11456
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 11457
    "Modified: / 19.5.1999 / 23:37:17 / cg"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11458
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11459
5207
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11460
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
 11461
    "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
 11462
     the view passed here is always the topView - not the view under the pointer.
6590
fbca4476f22c class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6565
diff changeset
 11463
     For compatibility with unix, we figure out the view here from the pointer position
fbca4476f22c class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6565
diff changeset
 11464
     and pass that one down (used to be the focus view, but that is inconvenient)."
fbca4476f22c class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6565
diff changeset
 11465
fbca4476f22c class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6565
diff changeset
 11466
    |wg screenPoint targetView|
5207
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11467
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11468
    aView isNil ifTrue:[
6601
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
 11469
	"/ event arrived, after I destroyed it myself
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
 11470
	^ self
6590
fbca4476f22c class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6565
diff changeset
 11471
    ].
fbca4476f22c class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6565
diff changeset
 11472
fbca4476f22c class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6565
diff changeset
 11473
    UserPreferences current mouseWheelFocusFollowsMouse ifTrue:[
6601
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
 11474
	screenPoint := self translatePointToRoot:(x@y) fromView:aView.
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
 11475
	targetView := self viewFromPoint:screenPoint.
6590
fbca4476f22c class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6565
diff changeset
 11476
    ].
fbca4476f22c class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6565
diff changeset
 11477
fbca4476f22c class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6565
diff changeset
 11478
    (targetView isNil) ifTrue:[
6601
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
 11479
	(wg := aView windowGroup) notNil ifTrue:[
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
 11480
	    targetView := wg focusView.
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
 11481
	].
6590
fbca4476f22c class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6565
diff changeset
 11482
    ].
fbca4476f22c class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6565
diff changeset
 11483
5230
071a281c6c42 debug prints
Claus Gittinger <cg@exept.de>
parents: 5207
diff changeset
 11484
    aView sensor
6601
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
 11485
	mouseWheelMotion:buttonState x:x y:y amount:amount deltaTime:dTime
b8861e87960d *** empty log message ***
sr
parents: 6590
diff changeset
 11486
	view:(targetView ? aView)
5207
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11487
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11488
    "Modified: / 21.5.1999 / 13:05:53 / cg"
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11489
!
8271db9f29ee fix around bug due to windows-wrong-view-in-mouseWheelEvent
sr
parents: 5198
diff changeset
 11490
4230
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11491
nativeWidgetCommand:commandId view:aView
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11492
    "forward a command event for some view.
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11493
     (Button, CheckBox etc.)"
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11494
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11495
    |sensor|
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11496
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11497
    aView isNil ifTrue:[
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11498
	"/ event arrived, after I destroyed it myself
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11499
	^ self
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11500
    ].
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11501
    sensor := aView sensor.
4249
af3c0e138c8a *** empty log message ***
ca
parents: 4248
diff changeset
 11502
    sensor
af3c0e138c8a *** empty log message ***
ca
parents: 4248
diff changeset
 11503
	nativeWidgetCommand:#'win32nativeWMCommand:'
af3c0e138c8a *** empty log message ***
ca
parents: 4248
diff changeset
 11504
	arguments:(Array with:commandId)
af3c0e138c8a *** empty log message ***
ca
parents: 4248
diff changeset
 11505
	view:aView
4230
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11506
!
6e80dbe10f18 nativeWidget stuff
Claus Gittinger <cg@exept.de>
parents: 4181
diff changeset
 11507
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11508
queryEndSession
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11509
    "system is about to be shut down.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11510
     This is a speciality of windows.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11511
     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
 11512
     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
 11513
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 11514
    '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
 11515
    ^ true
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11516
!
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11517
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11518
settingsChange
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11519
    "some system settings (users preferences) have changed.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11520
     This is a speciality of windows.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11521
     For now, only a few attributes are reinitialized."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11522
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11523
    self initializeVariableSettingsProperties.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11524
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 11525
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 11526
systemColorChange:aWindow
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11527
    "the system colors (users preferences) have changed.
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11528
     This is a speciality of windows.
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 11529
     Tell the viewStyle to update itself,
7305
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
 11530
     and tell all view to reinit its style.
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
 11531
5432ae3ce452 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7303
diff changeset
 11532
     The argument, aWindow is not used."
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 11533
2682
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
 11534
    |anyChange|
ad97ce27c345 check if SYSCOLORCHANGE is real
Claus Gittinger <cg@exept.de>
parents: 2681
diff changeset
 11535
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 11536
    IgnoreSysColorChanges ifFalse:[
7452
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11537
	"/ first check, if there was really a change of any color that
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11538
	"/ we are interested in
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11539
	"/ (when exceed is running, we get plenty of those messages ...)
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11540
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11541
	anyChange := false.
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11542
	SystemColorValues synchronized:[
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11543
	    SystemColorValues copy keysAndValuesDo:[:eachKey :eachOldColor|
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11544
		|newColor|
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11545
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11546
		newColor := self primGetSystemColor:eachKey.
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11547
		newColor ~= eachOldColor ifTrue:[
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11548
		    SystemColorValues at:eachKey put:newColor.
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11549
		    anyChange := true.
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11550
		].
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11551
	    ].
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11552
	    anyChange ifTrue:[
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11553
		SimpleView readStyleSheetAndUpdateAllStyleCaches.
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11554
		"/ TODO: this should go through the sensor ...
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11555
		"/ ...and be handled as an event by the views thread.
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11556
		self allViewsDo:[:eachView| eachView reinitStyle].
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11557
	    ].
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11558
	].
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 11559
    ]
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 11560
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 11561
    "
7452
cdf395e4ccaf #setId: is now implemented in GrahicsContext
Stefan Vogel <sv@exept.de>
parents: 7305
diff changeset
 11562
	Display systemColorChange:nil
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 11563
    "
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11564
!
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11565
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11566
trayAction:eventCode view:aView
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 11567
    "forward a tray event for some view."
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11568
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11569
    |sensor message arg|
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11570
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11571
    aView isNil ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11572
	"/ event arrived, after I destroyed it myself
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11573
	^ self
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11574
    ].
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11575
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11576
    eventCode == 512 "WM_MOUSEMOVE" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11577
	"/ mouse motion
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11578
	message := #trayMouseMotion
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11579
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11580
    eventCode == 513 "WM_LBUTTONDOWN" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11581
	"/ left-button-press
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11582
	message := #trayButtonPress:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11583
	arg := 1.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11584
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11585
    eventCode == 514 "WM_LBUTTONUP" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11586
	"/ left-button-release
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11587
	message := #trayButtonRelease:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11588
	arg := 1.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11589
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11590
    eventCode == 515 "WM_LBUTTONDBLCLK" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11591
	"/ left-button-double-click
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11592
	message := #trayButtonDoubleClick:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11593
	arg := 1.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11594
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11595
    eventCode == 516 "WM_RBUTTONDOWN" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11596
	"/ right-button-press
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11597
	message := #trayButtonPress:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11598
	arg := 3.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11599
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11600
    eventCode == 517 "WM_RBUTTONUP" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11601
	"/ right-button-release
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11602
	message := #trayButtonRelease:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11603
	arg := 3.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11604
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11605
    eventCode == 518 "WM_RBUTTONDBLCLK" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11606
	"/ left-button-double-click
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11607
	message := #trayButtonDoubleClick:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11608
	arg := 3.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11609
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11610
    eventCode == 519 "WM_MBUTTONDOWN" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11611
	"/ middle-button-press
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11612
	message := #trayButtonPress:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11613
	arg := 2.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11614
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11615
    eventCode == 520 "WM_MBUTTONUP" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11616
	"/ middle-button-release
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11617
	message := #trayButtonRelease:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11618
	arg := 2.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11619
    ].
4821
b8a6faa474ff *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4819
diff changeset
 11620
    eventCode == 521 "WM_MBUTTONDBLCLK" ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11621
	"/ middle-button-double-click
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11622
	message := #trayButtonDoubleClick:.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11623
	arg := 2.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11624
    ].
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11625
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11626
    message isNil ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11627
	Transcript showCR:eventCode.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11628
	^ self.
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11629
    ].
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11630
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11631
    sensor := aView sensor.
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11632
    sensor
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11633
	trayAction:message
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11634
	arguments:(Array with:arg)
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 11635
	view:aView
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11636
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11637
    "Created: / 31-10-2007 / 00:13:31 / cg"
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 11638
    "Modified: / 05-11-2007 / 12:14:28 / cg"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11639
! !
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11640
4236
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11641
!WinWorkstation methodsFor:'event forwarding-native'!
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11642
4239
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 11643
win32NativeScroll:scrollCode position:newPos view:aScrollBar
4236
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11644
    "native scrollbar widget event."
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11645
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11646
    aScrollBar isNil ifTrue:[
4237
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 11647
	"/ event arrived, after I destroyed it myself
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 11648
	^ self
4236
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11649
    ].
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11650
4248
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11651
    self class debugNative ifTrue:[
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11652
	'WinWorkstation [info]: native scroll event' infoPrint.
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11653
	    ' code=' infoPrint.
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11654
	    scrollCode infoPrint.
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11655
	    ' position=' infoPrint.
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11656
	    newPos infoPrintCR.
976b5e046d29 *** empty log message ***
ca
parents: 4247
diff changeset
 11657
    ].
4237
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 11658
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 11659
    aScrollBar sensor
4239
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 11660
	nativeWidgetCommand:#win32NativeScroll:position:
4237
68fcb2feaf0a *** empty log message ***
ca
parents: 4236
diff changeset
 11661
	arguments:(Array with:scrollCode with:newPos) view:aScrollBar
4236
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11662
! !
b494cf063864 *** empty log message ***
ca
parents: 4235
diff changeset
 11663
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11664
!WinWorkstation methodsFor:'event handling'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11665
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11666
dispatchEventFor:aViewIdOrNil withMask:eventMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11667
    "central event handling method:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11668
     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
 11669
     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
 11670
     otherwise only events for the view with given id are processed.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11671
     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
 11672
     handled.
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11673
     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
 11674
	      pending event before calling this."
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11675
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11676
    (self getEventFor:aViewIdOrNil withMask:eventMask) ifTrue:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11677
	AbortSignal handle:[:ex |
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11678
	    ex return
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11679
	] do:[
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11680
	    self dispatchLastEvent.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11681
	]
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11682
    ].
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11683
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11684
    "Modified: 19.8.1997 / 17:10:42 / cg"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11685
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11686
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11687
dispatchExposeEventFor:aViewIdOrNil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11688
    "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
 11689
     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
 11690
     otherwise only events for the view with given id are processed."
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
    self dispatchEventFor:aViewIdOrNil withMask:(self eventMaskFor:#expose)
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11693
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11694
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11695
dispatchLastEvent
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11696
    |theView symS arg butt sibling windowID siblingID propertyID selectionID targetID requestorID
5964
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 11697
     eventType hotkeyId|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11698
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11699
%{  /* xxSTACK: 8000 */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11700
    struct queuedEvent *ev = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11701
    struct queuedEvent _ev_buf;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11702
    struct inlineCache *ipS;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11703
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11704
    static struct inlineCache vid = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11705
    static struct inlineCache conf = _ILC5;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11706
    static struct inlineCache skp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11707
    static struct inlineCache skr = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11708
    static struct inlineCache exp = _ILC5;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11709
    static struct inlineCache gexpS = _ILC6;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11710
    static struct inlineCache nexpS = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11711
    static struct inlineCache clr = _ILC5;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11712
    static struct inlineCache bp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11713
    static struct inlineCache br = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11714
    static struct inlineCache bmp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11715
    static struct inlineCache bsp = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11716
    static struct inlineCache mot = _ILC4;
2733
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
 11717
    static struct inlineCache mwh = _ILC6;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11718
    static struct inlineCache unmap = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11719
    static struct inlineCache map = _ILC1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11720
    static struct inlineCache termS = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11721
    static struct inlineCache destr = _ILC1;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11722
    static struct inlineCache setCurs = _ILC1;
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11723
    static struct inlineCache focOut = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11724
    static struct inlineCache focIn = _ILC1;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11725
    static struct inlineCache act = _ILC2;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11726
    static struct inlineCache pe = _ILC4;
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11727
    static struct inlineCache pl = _ILC2;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11728
    static struct inlineCache vis = _ILC1;
2325
d95eb3639ca2 sysColorChange
Claus Gittinger <cg@exept.de>
parents: 2310
diff changeset
 11729
    static struct inlineCache sysClrChg = _ILC1;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11730
    static struct inlineCache fontChg = _ILC0;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 11731
    static struct inlineCache settingChg = _ILC0;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 11732
    static struct inlineCache qEndSess = _ILC0;
4832
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 11733
    static struct inlineCache power = _ILC0;
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 11734
    static struct inlineCache quit = _ILC0;
4145
c1d5d9449460 preps for native widgets
ca
parents: 4143
diff changeset
 11735
    static struct inlineCache command = _ILC2;
4819
a002a6d6ed4c trayEvents
Claus Gittinger <cg@exept.de>
parents: 4816
diff changeset
 11736
    static struct inlineCache trayMessage = _ILC2;
4239
363116abbf51 *** empty log message ***
ca
parents: 4238
diff changeset
 11737
    static struct inlineCache win32NativeScroll = _ILC3;
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
 11738
    static struct inlineCache win32DrawItem = _ILC2;
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 11739
    static struct inlineCache copyData = _ILC3;
4457
de5fd63eaa8c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4455
diff changeset
 11740
    static struct inlineCache dropFiles = _ILC4;
5964
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 11741
    static struct inlineCache hkp = _ILC3;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11742
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11743
    int x, y, w, h;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11744
    int keyCode, modifiers, isDoubleClick = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11745
    int isDown = 1;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 11746
    int state, dir;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11747
    OBJ upDown;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11748
    OBJ eB;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11749
    char nameBuffer[100];
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11750
    HWND hWnd = 0;
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
 11751
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
 11752
    DDDPRINTF(("dispatchLast\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11753
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11754
    eB = __INST(eventBuffer);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11755
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11756
    if (__isByteArray(eB)) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11757
	ev = (struct queuedEvent *)(__ByteArrayInstPtr(eB)->ba_element);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11758
    } else {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11759
	console_fprintf(stderr, "WinWorkstation [error]: no eventBuffer\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11760
	RETURN (false);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11761
    }
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 11762
    if (ev) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11763
	_ev_buf = *ev;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11764
	ev = &_ev_buf;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11765
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11766
    hWnd = ev->ev_hWnd;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11767
    if (!(hWnd /*&& IsWindow(hWnd)*/)) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11768
	DPRINTF(("wrong hWnd in event in dispatchLastEvent\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11769
	RETURN (false);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11770
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 11771
    {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11772
	OBJ t;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11773
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11774
	/*
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11775
	 * very often, its another event for the same view ...
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11776
	 * avoid creation & lookup then.
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11777
	 */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 11778
#if 1
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11779
	if ((t = __INST(lastId)) != nil) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11780
	    if (__isExternalAddress(t)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11781
		if (_HWNDVal(t) == hWnd) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11782
		    theView = __INST(lastView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11783
		    if (__isNonNilObject(theView)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11784
			if (__qClass(theView) == nil) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11785
			    theView = nil;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11786
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11787
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11788
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11789
	    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11790
	}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11791
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11792
	if (theView == nil) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11793
	    windowID = __MKOBJ(ev->ev_hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11794
	    theView = (*vid.ilc_func)(self, @symbol(viewFromId:), nil, &vid, windowID);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11795
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11796
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11797
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11798
    if (theView == nil) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11799
	DPRINTF(("nil view [hWnd=%x msg=0x%x] in dispatchEvent\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11800
		 ev->ev_hWnd, ev->ev_message));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11801
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11802
	RETURN (false);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11803
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 11804
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 11805
    switch (ev->ev_message) {
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 11806
	    DPRINTFIF((__debug_WM_ALL__) , ("message=%d 0x%x wparam=%"_lx_" hwnd=%"_lx_" arg1=%"_lx_")\n",
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 11807
			ev->ev_message, ev->ev_message, (INT)(ev->ev_wParam), (INT)(ev->ev_hWnd), (INT)(ev->ev_arg1)));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11808
	    case WM_WINDOWPOSCHANGED:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11809
		{
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11810
		    RECT rct;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11811
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11812
		    x = ev->ev_x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11813
		    y = ev->ev_y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11814
		    w = ev->ev_w;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11815
		    h = ev->ev_h;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11816
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11817
		    DPRINTF((">>> WM_WINDOWPOSCHANGED -> configure %d/%d , %d/%d\n", x,y,w,h));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11818
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11819
		    (*conf.ilc_func)(self,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11820
				     @symbol(configureX:y:width:height:view:),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11821
				     nil, &conf,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11822
				     __MKSMALLINT(x),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11823
				     __MKSMALLINT(y),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11824
				     __MKSMALLINT(w),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11825
				     __MKSMALLINT(h),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11826
				     theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11827
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11828
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11829
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11830
	    case WM_DROPFILES:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11831
		{
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11832
		    HDROP hDrop = (HDROP) ev->ev_wParam;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11833
		    int   count = DragQueryFile( hDrop,0xffffffff,0,0 );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11834
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 11835
		    DPRINTFIF((__debug_WM_DROPFILES__ | __debug_WM_ALL__) , ("count=%d hDrop=%x\n", count, hDrop));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11836
		    if (count > 0) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11837
			OBJ  dropHandle, files, position;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11838
			char buf[MAXPATH];
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11839
			int  i;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11840
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11841
			dropHandle = __MKOBJ(hDrop);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11842
			__PROTECT__(dropHandle);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11843
			files = __ARRAY_NEW_INT( count );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11844
			__UNPROTECT__(dropHandle);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11845
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11846
			for (i = 0;i < count;i++) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11847
			    OBJ s;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11848
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11849
			    DragQueryFile(hDrop,i,buf,sizeof(buf));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11850
			    __PROTECT__(dropHandle);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11851
			    __PROTECT__(files);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11852
			    s = __MKSTRING(buf);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11853
			    __UNPROTECT__(files);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11854
			    __UNPROTECT__(dropHandle);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11855
			    __ArrayInstPtr(files)->a_element[i] = s; __STORE(files, s);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11856
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11857
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11858
			{
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11859
			    POINT pos;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11860
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11861
			    DragQueryPoint(hDrop, &pos);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11862
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11863
			    __PROTECT__(dropHandle);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11864
			    __PROTECT__(files);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11865
			    position = __MKPOINT_INT(pos.x, pos.y);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11866
			    __UNPROTECT__(files);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11867
			    __UNPROTECT__(dropHandle);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11868
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11869
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11870
			(*dropFiles.ilc_func)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11871
			    ( self
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11872
			      , @symbol(dropFiles:view:position:handle:)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11873
			      , nil, &dropFiles,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11874
			      files, theView, position, dropHandle
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11875
			    );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11876
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11877
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11878
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11879
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11880
	    case WM_SHOWWINDOW:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11881
		if (ev->ev_wParam == TRUE) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11882
		    DPRINTF((">>> WM_SHOWWINDOW -> mappedView:\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11883
		    arg = @symbol(unobscured);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11884
		    (*vis.ilc_func)(theView,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11885
				    @symbol(visibilityChange:),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11886
				    nil, &vis, arg);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11887
		    (*map.ilc_func)(self,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11888
				    @symbol(mappedView:),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11889
				    nil, &map, theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11890
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11891
		    DPRINTF((">>> WM_SHOWWINDOW -> unMappedView:\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11892
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11893
		    arg = @symbol(fullyObscured);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11894
		    (*vis.ilc_func)(theView,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11895
				    @symbol(visibilityChange:),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11896
				    nil, &vis, arg);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11897
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11898
		    (*unmap.ilc_func)(self,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11899
				      @symbol(unmappedView:),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11900
				      nil, &unmap, theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11901
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11902
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11903
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11904
	    case __WM_ICONIFIED:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11905
		if (ev->ev_wParam) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11906
		    DPRINTF((">>> __WM_ICONIFIED -> unMappedView:\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11907
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11908
		    arg = @symbol(fullyObscured);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11909
		    (*vis.ilc_func)(theView,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11910
				    @symbol(visibilityChange:),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11911
				    nil, &vis, arg);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11912
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11913
		    (*unmap.ilc_func)(self,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11914
				      @symbol(unmappedView:),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11915
				      nil, &unmap, theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11916
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11917
		    DPRINTF((">>> __WM_DEICONIFIED -> mappedView:\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11918
		    arg = @symbol(unobscured);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11919
		    (*vis.ilc_func)(theView,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11920
				    @symbol(visibilityChange:),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11921
				    nil, &vis, arg);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11922
		    (*map.ilc_func)(self,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11923
				    @symbol(mappedView:),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11924
				    nil, &map, theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11925
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11926
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11927
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11928
	    case WM_CLOSE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11929
		DPRINTF((">>> WM_CLOSE -> terminateView:\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11930
		(*termS.ilc_func)(self,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11931
				  @symbol(terminateView:),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11932
				  nil, &termS, theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11933
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11934
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11935
	    case WM_DESTROY:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11936
		DPRINTF((">>> WM_DESTROY -> destroyedView\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11937
		(*destr.ilc_func)(self,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11938
				  @symbol(destroyedView:),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11939
				  nil, &destr, theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11940
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11941
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11942
	    case WM_ACTIVATE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11943
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11944
		switch (LOWORD(ev->ev_wParam)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11945
		    case WA_INACTIVE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11946
			DPRINTF((">>> WM_ACTIVATE inactive h=%x\n", ev->ev_hWnd));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11947
			(*act.ilc_func)(self,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11948
					@symbol(activate:view:),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11949
					nil, &act,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11950
					false, theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11951
			break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11952
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11953
		    case WA_ACTIVE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11954
		    case WA_CLICKACTIVE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11955
			DPRINTF((">>> WM_ACTIVATE active h=%x\n", ev->ev_hWnd));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11956
			(*act.ilc_func)(self,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11957
					@symbol(activate:view:),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11958
					nil, &act,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11959
					true, theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11960
			break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11961
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11962
		    default:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11963
			break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11964
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11965
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11966
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11967
	    case WM_MOUSEACTIVATE:
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 11968
		if (__debug_WM_MOUSEACTIVATE__ | __debug_WM_ALL__) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11969
		    PRINTF((">>> WM_MOUSEACTIVATE h=%x -> focusInView:\n", ev->ev_hWnd));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11970
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11971
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11972
		(*focIn.ilc_func)(self,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11973
				  @symbol(focusInView:),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11974
				  nil, &focIn, theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11975
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11976
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11977
	    case WM_SETFOCUS:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
 11978
		DPRINTFIF(__debug_WM_FOCUS__ , (">>> WM_SETFOCUS h=%x -> focusInView:\n", ev->ev_hWnd));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11979
		(*focIn.ilc_func)(self,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11980
				  @symbol(focusInView:),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11981
				  nil, &focIn, theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11982
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11983
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11984
	    case WM_KILLFOCUS:
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
 11985
		DPRINTFIF(__debug_WM_FOCUS__ , (">>> WM_KILLFOCUS h=%x -> focusOutOfView\n", ev->ev_hWnd));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11986
		(*focOut.ilc_func)(self,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11987
				   @symbol(focusOutView:),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11988
				   nil, &focOut, theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11989
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11990
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11991
	    case __WM_GEXPOSE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11992
		x = ev->ev_x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11993
		y = ev->ev_y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11994
		w = ev->ev_w;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11995
		h = ev->ev_h;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11996
		DPRINTF((">>> __WM_GEXPOSE -> gExpose %d/%d -> %d/%d\n", x, y, w, h));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11997
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11998
		if (GetWindow_unmapping(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 11999
		    console_fprintf(stderr, "oops - __WM_GEXPOSE for unmapping\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12000
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12001
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12002
		(*gexpS.ilc_func)(self,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12003
				  @symbol(graphicsExposeX:y:width:height:final:view:),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12004
				  nil, &gexpS,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12005
				  __MKSMALLINT(x),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12006
				  __MKSMALLINT(y),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12007
				  __MKSMALLINT(w),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12008
				  __MKSMALLINT(h),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12009
				  ev->ev_wParam ? true : false,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12010
				  theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12011
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12012
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12013
	    case __WM_NOGEXPOSE:
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 12014
		DPRINTFIF((__debug_WM_EXPOSE__ | __debug_WM_ALL__), (">>> __WM_NOGEXPOSE -> noExpose\n"));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12015
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12016
		if (GetWindow_unmapping(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12017
		    console_fprintf(stderr, "oops - __WM_NOGEXPOSE for unmapping\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12018
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12019
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12020
		 (*nexpS.ilc_func)(self,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12021
				   @symbol(noExposeView:), nil, &nexpS,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12022
				   theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12023
		break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12024
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 12025
# ifdef LATE_GENERATE_EXPOSE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12026
	    case __WM_PAINT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12027
		{
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12028
		    PAINTSTRUCT ps;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12029
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12030
		    AQUIRE_DRAW_MUTEX
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12031
		    __generateExposes(hWnd, NULL, WM_PAINT, 0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12032
		    RELEASE_DRAW_MUTEX
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 12033
3735
d8d32e0ff26e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3721
diff changeset
 12034
# if 0
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12035
		    BeginPaint(hWnd, &ps);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12036
		    EndPaint(hWnd, &ps);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12037
# endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12038
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12039
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12040
# endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12041
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12042
	    case WM_PAINT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12043
		x = ev->ev_x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12044
		y = ev->ev_y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12045
		w = ev->ev_w;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12046
		h = ev->ev_h;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12047
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12048
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12049
		if (GetWindow_unmapping(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12050
		    console_fprintf(stderr, "oops - WM_PAINT for unmapping\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12051
		}
3741
42ca299b104f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3735
diff changeset
 12052
#endif
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 12053
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 12054
#ifndef PRE_21_NOV
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12055
		__clearWindow(hWnd, x, y, w, h);
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 12056
#else
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 12057
# if WM_PAINT_CLEAR_LATE
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12058
		__clearWindow(hWnd, x, y, w, h);
3958
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 12059
# endif
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 12060
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 12061
#endif
cc150a3525b9 bugfix: redraw windows
ca
parents: 3951
diff changeset
 12062
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 12063
#ifdef DEBUG_COLORIZE_WM_PAINT_RECTS2
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12064
		{
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12065
		    HDC hDC;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12066
		    HBRUSH hBrush;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12067
		    RECT rect;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12068
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12069
		    hBrush = CreateSolidBrush(BlackPixel);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12070
		    hDC = GetWindowDC(hWnd);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12071
		    SelectClipRgn(hDC, NULL);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12072
		    rect.left = x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12073
		    rect.top = y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12074
		    rect.right = x+w;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12075
		    rect.bottom = y+h;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12076
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12077
		    FillRect(hDC, &rect, hBrush);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12078
		    _DeleteBrush(hBrush, __LINE__);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12079
		    ReleaseDC(hWnd, hDC);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12080
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12081
#endif
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 12082
		if (__debug_WM_PAINT__ | __debug_WM_ALL__) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12083
		    PRINTF((">>> WM_PAINT -> expose %d/%d -> %d/%d\n", x, y, w, h));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12084
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12085
		(*exp.ilc_func)(self,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12086
			 @symbol(exposeX:y:width:height:view:),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12087
			 nil, &exp,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12088
			 __MKSMALLINT(x),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12089
			 __MKSMALLINT(y),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12090
			 __MKSMALLINT(w),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12091
			 __MKSMALLINT(h),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12092
			 theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12093
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12094
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12095
	    case WM_LBUTTONDBLCLK:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12096
		isDoubleClick = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12097
		butt = __MKSMALLINT(Button1);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12098
		goto commonButton;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12099
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12100
	    case WM_LBUTTONUP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12101
		isDown = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12102
		butt = __MKSMALLINT(Button1);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12103
		goto commonButton;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12104
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12105
	    case WM_LBUTTONDOWN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12106
		butt = __MKSMALLINT(Button1);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12107
		goto commonButton;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12108
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12109
	    case WM_MBUTTONDBLCLK:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12110
		isDoubleClick = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12111
		butt = __MKSMALLINT(Button2);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12112
		goto commonButton;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12113
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12114
	    case WM_MBUTTONUP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12115
		isDown = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12116
		butt = __MKSMALLINT(Button2);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12117
		goto commonButton;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12118
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12119
	    case WM_MBUTTONDOWN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12120
		butt = __MKSMALLINT(Button2);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12121
		goto commonButton;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12122
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12123
	    case WM_RBUTTONDBLCLK:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12124
		isDoubleClick = 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12125
		butt = __MKSMALLINT(Button3);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12126
		goto commonButton;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12127
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12128
	    case WM_RBUTTONUP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12129
		isDown = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12130
		butt = __MKSMALLINT(Button3);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12131
		goto commonButton;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12132
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12133
	    case WM_RBUTTONDOWN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12134
		butt = __MKSMALLINT(Button3);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12135
		goto commonButton;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12136
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12137
	    commonButton:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12138
		x = ev->ev_x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12139
		y = ev->ev_y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12140
		modifiers = ev->ev_modifiers;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12141
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12142
		if (__INST(buttonTranslation) != nil) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12143
		    butt = __AT_(__INST(buttonTranslation), butt);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12144
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12145
		arg = butt;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12146
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12147
		__INST(altDown) = (modifiers & AltMask) ? true : false;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12148
		__INST(metaDown) = (modifiers & MetaMask) ? true : false;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12149
		__INST(shiftDown) = (modifiers & ShiftMask) ? true : false;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12150
		__INST(ctrlDown) = (modifiers & ControlMask) ? true : false;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12151
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12152
		if (deltaDoubleClickX == -999) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12153
		    deltaDoubleClickX = GetSystemMetrics(SM_CXDOUBLECLK);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12154
		    deltaDoubleClickY = GetSystemMetrics(SM_CYDOUBLECLK);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12155
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12156
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12157
		if (isDoubleClick) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12158
		    multiClickCount = 2;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12159
		    ipS = &bmp;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12160
		    symS = @symbol(buttonMultiPress:x:y:view:);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12161
		    nextMultiClickTime = ev->ev_time + __intVal(__INST(multiClickTimeDelta));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12162
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12163
		    if (isDown) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12164
			if (multiClickCount
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12165
			 && (ev->ev_time < nextMultiClickTime)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12166
			 && (butt == lastButton)
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12167
			 && (x >= (lastClickX - (deltaDoubleClickX / 2)))
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12168
			 && (x <= (lastClickX + (deltaDoubleClickX / 2)))
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12169
			 && (y >= (lastClickY - (deltaDoubleClickY / 2)))
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12170
			 && (y <= (lastClickY + (deltaDoubleClickY / 2)))
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12171
			) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12172
			    ipS = &bmp;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12173
			    symS = @symbol(buttonMultiPress:x:y:view:);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12174
			} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12175
			    ipS = &bp;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12176
			    symS = @symbol(buttonPress:x:y:view:);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12177
			    multiClickCount = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12178
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12179
			multiClickCount = multiClickCount + 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12180
			nextMultiClickTime = ev->ev_time + __intVal(__INST(multiClickTimeDelta));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12181
		    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12182
			ipS = &br;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12183
			symS = @symbol(buttonRelease:x:y:view:);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12184
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12185
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12186
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12187
		if (isDown || isDoubleClick) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12188
		    lastClickX = x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12189
		    lastClickY = y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12190
		    lastButton = butt;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12191
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12192
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 12193
		if (__debug_WM_BUTTONUP__ | __debug_WM_BUTTONDOWN__ | __debug_WM_ALL__) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12194
		    if (__isSymbol(arg)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12195
			PRINTF(("buttonPress/buttonRelease: %s %d/%d\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12196
				    __stringVal(arg), x, y));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12197
		    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12198
			PRINTF(("buttonPress/buttonRelease: %d %d/%d\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12199
				    __intVal(arg), x, y));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12200
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12201
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12202
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12203
		(*(*ipS).ilc_func)(self, symS, nil, ipS,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12204
				   arg,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12205
				   __MKSMALLINT(x),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12206
				   __MKSMALLINT(y),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12207
				   theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12208
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12209
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12210
	    case __WM_MOUSEENTER:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12211
		x = ev->ev_x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12212
		y = ev->ev_y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12213
		state = ev->ev_modifiers;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12214
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 12215
		if (__debug_WM_MOUSEENTER__ | __debug_WM_ALL__) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12216
		    PRINTF((">>> WM_MOUSEENTER: %x %d/%d state:%x\n", ev->ev_hWnd, x, y, state));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12217
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12218
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12219
		if (GetWindow_unmapping(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12220
		    console_fprintf(stderr, "oops - WM_MOUSEENTER for unmapping\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12221
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12222
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12223
		(*pe.ilc_func)(self, @symbol(pointerEnter:x:y:view:),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12224
				    nil, &pe,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12225
				    __MKSMALLINT(state),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12226
				    __MKSMALLINT(x),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12227
				    __MKSMALLINT(y),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12228
				    theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12229
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12230
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12231
	    case __WM_MOUSELEAVE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12232
		state = ev->ev_modifiers;
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 12233
		if (__debug_WM_MOUSELEAVE__ | __debug_WM_ALL__) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12234
		    PRINTF((">>> WM_MOUSELEAVE: %x state:%x\n", ev->ev_hWnd, state));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12235
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12236
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12237
		if (GetWindow_unmapping(hWnd)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12238
		    console_fprintf(stderr, "oops - WM_MOUSELEAVE for unmapping\n");
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12239
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12240
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12241
		(*pl.ilc_func)(self, @symbol(pointerLeave:view:),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12242
				    nil, &pl,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12243
				    __MKSMALLINT(state),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12244
				    theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12245
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12246
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12247
	    case WM_MOUSEMOVE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12248
		x = ev->ev_x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12249
		y = ev->ev_y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12250
		state = ev->ev_modifiers;
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 12251
		if (__debug_WM_MOUSEMOVE__ | __debug_WM_ALL__) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12252
		    PRINTF((">>> WM_MOUSEMOVE: %d/%d %x\n", x, y, state));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12253
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12254
		(*mot.ilc_func)(self, @symbol(buttonMotion:x:y:view:),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12255
				    nil, &mot,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12256
				    __MKSMALLINT(state),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12257
				    __MKSMALLINT(x),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12258
				    __MKSMALLINT(y),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12259
				    theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12260
		break;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12261
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 12262
#ifdef WM_MOUSEWHEEL
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12263
	    case WM_MOUSEWHEEL:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12264
		x = ev->ev_x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12265
		y = ev->ev_y;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12266
		state = ev->ev_modifiers;
8173
24ca1712f183 fixed mouseWheelMotion event for 64bit system
Claus Gittinger <cg@exept.de>
parents: 8144
diff changeset
 12267
		dir = GET_WHEEL_DELTA_WPARAM(ev->ev_wParam);
24ca1712f183 fixed mouseWheelMotion event for 64bit system
Claus Gittinger <cg@exept.de>
parents: 8144
diff changeset
 12268
		// dir = ev->ev_wParam & 0xFFFF;
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12269
		DPRINTF((">>> WM_MOUSEWHEEL: %d %x\n", dir, state));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12270
		{
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12271
		    OBJ tim;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12272
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12273
		    __PROTECT__(theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12274
		    tim = __MKUINT(ev->ev_time);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12275
		    __UNPROTECT__(theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12276
		    (*mwh.ilc_func)(self, @symbol(mouseWheelMotion:x:y:amount:deltaTime:view:),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12277
				    nil, &mwh,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12278
				    __MKSMALLINT(state),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12279
				    __MKSMALLINT(x),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12280
				    __MKSMALLINT(y),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12281
				    __MKSMALLINT(dir),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12282
				    tim,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12283
				    theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12284
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12285
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12286
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12287
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12288
	    case WM_CHAR:
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 12289
		DPRINTFIF((__debug_WM_CHAR__ | __debug_WM_ALL__)  , ("WM_CHAR %x %d/%d\n", ev->ev_keyCode, ev->ev_x, ev->ev_y));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12290
		DPRINTF((">>> WM_CHAR: %d/%d\n", x, y));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12291
		symS = @symbol(keyPress:x:y:view:);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12292
		ipS = &skp;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12293
		upDown = true;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12294
		goto keyPressAndRelease;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12295
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12296
	    case WM_HOTKEY:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12297
		{
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12298
		(*hkp.ilc_func)(self, @symbol(hotkeyWithId:key:view:),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12299
				    nil, &hkp,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12300
				    __MKSMALLINT(ev->ev_wParam),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12301
				    __MKSMALLINT(ev->ev_arg1),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12302
				    theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12303
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12304
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12305
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12306
	    case WM_SYSKEYUP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12307
	    case WM_KEYUP:
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 12308
		DPRINTFIF((__debug_WM_KEYUP__ | __debug_WM_ALL__)  , (">>> WM_KEYUP / SYSKEYUP: %x %d/%d\n", ev->ev_keyCode, ev->ev_x, ev->ev_y));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12309
		symS = @symbol(keyRelease:x:y:view:);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12310
		ipS = &skr;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12311
		upDown = false;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12312
		goto keyPressAndRelease;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12313
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12314
	    case WM_SYSKEYDOWN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12315
	    case WM_KEYDOWN:
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 12316
		DPRINTFIF((__debug_WM_KEYUP__ | __debug_WM_ALL__)  , (">>> WM_KEYDOWN / SYSKEYDOWN: %x %d/%d\n", ev->ev_keyCode, ev->ev_x, ev->ev_y));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12317
		symS = @symbol(keyPress:x:y:view:);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12318
		ipS = &skp;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12319
		upDown = true;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12320
		/* FALL INTO */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12321
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12322
	    keyPressAndRelease: ;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12323
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12324
		x = ev->ev_x;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12325
		y = ev->ev_y;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12326
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12327
#ifdef NOTDEF
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12328
		{
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12329
		    BYTE vKeyState[256];
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12330
		    char buff[5];
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12331
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12332
		    GetKeyboardState(vKeyState);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12333
		    ToAscii(ev->ev_keyCode, ev->ev_scanCode, vKeyState, &buff; 0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12334
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12335
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12336
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12337
		keyCode = ev->ev_keyCode;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12338
		modifiers = ev->ev_modifiers;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12339
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12340
		if (modifiers & TRANSLATED_KEY) {
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 12341
#if 1
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12342
		    if (modifiers & ControlMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12343
			if (keyCode < 0x20) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12344
			    keyCode = keyCode + 'a' - 1;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12345
			    if (modifiers & ShiftMask) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12346
				keyCode = keyCode - 'a' + 'A';
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12347
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12348
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12349
		    } else if (modifiers & (MetaMask | AltMask)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12350
			if (! (modifiers & ShiftMask)) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12351
			    if ((keyCode >= 'A') && (keyCode <= 'Z')) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12352
				keyCode = keyCode - 'A' + 'a';
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12353
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12354
			}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12355
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12356
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12357
		    arg = __MKSMALLINT(keyCode & 0xFFFF);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12358
		} else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12359
		    switch (keyCode) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12360
			case VK_F1:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12361
			    arg = @symbol(F1);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12362
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12363
			case VK_F2:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12364
			    arg = @symbol(F2);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12365
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12366
			case VK_F3:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12367
			    arg = @symbol(F3);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12368
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12369
			case VK_F4:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12370
			    arg = @symbol(F4);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12371
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12372
			case VK_F5:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12373
			    arg = @symbol(F5);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12374
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12375
			case VK_F6:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12376
			    arg = @symbol(F6);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12377
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12378
			case VK_F7:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12379
			    arg = @symbol(F7);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12380
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12381
			case VK_F8:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12382
			    arg = @symbol(F8);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12383
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12384
			case VK_F9:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12385
			    arg = @symbol(F9);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12386
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12387
			case VK_F10:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12388
			    arg = @symbol(F10);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12389
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12390
			case VK_F11:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12391
			    arg = @symbol(F11);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12392
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12393
			case VK_F12:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12394
			    arg = @symbol(F12);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12395
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12396
			case VK_PRIOR:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12397
			    arg = @symbol(Prior);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12398
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12399
			case VK_NEXT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12400
			    arg = @symbol(Next);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12401
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12402
			case VK_END:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12403
			    arg = @symbol(End);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12404
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12405
			case VK_HOME:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12406
			    arg = @symbol(Home);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12407
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12408
			case VK_LEFT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12409
			    arg = @symbol(CursorLeft);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12410
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12411
			case VK_RIGHT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12412
			    arg = @symbol(CursorRight);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12413
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12414
			case VK_UP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12415
			    arg = @symbol(CursorUp);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12416
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12417
			case VK_DOWN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12418
			    arg = @symbol(CursorDown);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12419
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12420
			case VK_MENU:  /*alt key with w95 ???*/
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12421
			    arg = @symbol(Menu);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12422
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12423
			case VK_LMENU:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12424
			    arg = @symbol(Menu_L);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12425
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12426
			case VK_RMENU:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12427
			    arg = @symbol(Menu_R);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12428
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12429
			case VK_PAUSE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12430
			    arg = @symbol(Pause);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12431
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12432
			case VK_HELP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12433
			    arg = @symbol(Help);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12434
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12435
			case VK_EXECUTE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12436
			    arg = @symbol(Execute);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12437
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12438
			case VK_CANCEL:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12439
			    arg = @symbol(Cancel);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12440
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12441
			case VK_SELECT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12442
			    arg = @symbol(Select);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12443
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12444
			case VK_PRINT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12445
			    arg = @symbol(Print);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12446
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12447
			case VK_SNAPSHOT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12448
			    arg = @symbol(Snapshot);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12449
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12450
			case VK_INSERT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12451
			    arg = @symbol(Insert);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12452
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12453
			case VK_DELETE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12454
			    arg = @symbol(Delete);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12455
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12456
			case VK_BACK:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12457
			    arg = @symbol(BackSpace);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12458
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12459
			case VK_LWIN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12460
			    arg = @symbol(Win_L);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12461
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12462
			case VK_RWIN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12463
			    arg = @symbol(Win_R);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12464
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12465
			case VK_APPS:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12466
			    arg = @symbol(Appl);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12467
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12468
			case VK_NUMPAD0:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12469
			    arg = @symbol(KeyPad0);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12470
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12471
			case VK_NUMPAD1:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12472
			    arg = @symbol(KeyPad1);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12473
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12474
			case VK_NUMPAD2:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12475
			    arg = @symbol(KeyPad2);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12476
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12477
			case VK_NUMPAD3:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12478
			    arg = @symbol(KeyPad3);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12479
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12480
			case VK_NUMPAD4:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12481
			    arg = @symbol(KeyPad4);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12482
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12483
			case VK_NUMPAD5:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12484
			    arg = @symbol(KeyPad5);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12485
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12486
			case VK_NUMPAD6:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12487
			    arg = @symbol(KeyPad6);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12488
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12489
			case VK_NUMPAD7:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12490
			    arg = @symbol(KeyPad7);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12491
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12492
			case VK_NUMPAD8:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12493
			    arg = @symbol(KeyPad8);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12494
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12495
			case VK_NUMPAD9:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12496
			    arg = @symbol(KeyPad9);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12497
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12498
			case VK_LSHIFT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12499
			    arg = @symbol(Shift_L);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12500
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12501
			case VK_RSHIFT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12502
			    arg = @symbol(Shift_R);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12503
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12504
			case VK_LCONTROL:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12505
			    arg = @symbol(Ctrl_L);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12506
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12507
			case VK_RCONTROL:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12508
			    arg = @symbol(Ctrl_R);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12509
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12510
			case VK_CONTROL:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12511
			    arg = @symbol(Ctrl);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12512
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12513
			case VK_SHIFT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12514
			    arg = @symbol(Shift);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12515
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12516
			case VK_TAB:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12517
			    arg = @symbol(Tab);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12518
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12519
			case VK_ESCAPE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12520
			    arg = @symbol(Escape);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12521
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12522
			case VK_NUMLOCK:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12523
			    arg = @symbol(NumLock);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12524
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12525
			case VK_SCROLL:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12526
			    arg = @symbol(ScrollLock);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12527
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12528
			case VK_RETURN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12529
			    arg = @symbol(Return);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12530
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12531
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12532
			default:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12533
#if 0
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12534
			    nameBuffer[0] = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12535
			    GetKeyNameText(ev->ev_scanCode, nameBuffer, sizeof(nameBuffer));
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 12536
			    if (__debug_WM_KEYUP__ | __debug_WM_KEYDOWN__ | __debug_WM_CHAR__ | __debug_WM_ALL__) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12537
				PRINTF(("char is <%d>\n", keyCode));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12538
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12539
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12540
			    arg = __MKSMALLINT(keyCode & 0xFFFF);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12541
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12542
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12543
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12544
		__INST(altDown) = (modifiers & AltMask) ? true : false;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12545
		__INST(metaDown) = (modifiers & MetaMask) ? true : false;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12546
		__INST(shiftDown) = (modifiers & ShiftMask) ? true : false;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12547
		__INST(ctrlDown) = (modifiers & ControlMask) ? true : false;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12548
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 12549
		if (__debug_WM_CHAR__ | __debug_WM_KEYUP__ | __debug_WM_KEYDOWN__ | __debug_WM_ALL__) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12550
		    PRINTF(("%s: code=%x mod=%x ", __stringVal(symS), keyCode, modifiers));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12551
		    PRINTF((" alt=%d meta=%d ", __INST(altDown) == true , __INST(metaDown) == true));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12552
		    PRINTF((" sh=%d ctrl=%d", __INST(shiftDown) == true , __INST(ctrlDown) == true));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12553
		    PRINTF((" arg=%x\n", arg));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12554
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12555
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12556
		(*(*ipS).ilc_func)(self, symS, nil, ipS,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12557
				   arg,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12558
				   __MKSMALLINT(x),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12559
				   __MKSMALLINT(y),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12560
				   theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12561
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12562
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12563
	   case WM_SYSCOLORCHANGE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12564
		DPRINTF((">>> WM_SYSCOLORCHANGE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12565
		(*sysClrChg.ilc_func)(self, @symbol(systemColorChange:), nil, &sysClrChg, theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12566
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12567
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12568
	   case WM_FONTCHANGE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12569
		DPRINTF((">>> WM_FONTCHANGE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12570
		(*fontChg.ilc_func)(self, @symbol(fontChange), nil, &fontChg);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12571
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12572
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12573
	   case WM_WININICHANGE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12574
		DPRINTF((">>> WM_WININICHANGE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12575
		(*settingChg.ilc_func)(self, @symbol(settingsChange), nil, &settingChg);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12576
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12577
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12578
	   case WM_DISPLAYCHANGE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12579
		DPRINTF((">>> WM_DISPLAYCHANGE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12580
		(*fontChg.ilc_func)(self, @symbol(displayChange), nil, &fontChg);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12581
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12582
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12583
	   case WM_QUERYENDSESSION:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12584
		DPRINTF((">>> WM_QUERYENDSESSION\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12585
		(*qEndSess.ilc_func)(self, @symbol(queryEndSession), nil, &qEndSess);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12586
		break;
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12587
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 12588
#ifdef LATER
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12589
	   case WM_POWER:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12590
		DPRINTF((">>> WM_POWER\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12591
		(*power.ilc_func)(self, @symbol(powerDown), nil, &power);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12592
	       break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12593
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12594
	    /* native widget actions */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12595
	    case WM_COMMAND:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12596
		DPRINTF((">>> WM_COMMAND\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12597
		(*command.ilc_func)(self, @symbol(nativeWidgetCommand:view:), nil, &command,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12598
				__MKSMALLINT(ev->ev_wParam), theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12599
	       break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12600
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12601
	    /* tray action */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12602
	    case WM_TRAY_MESSAGE:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12603
		DPRINTF((">>> WM_TRAY_MESSAGE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12604
		(*trayMessage.ilc_func)(self, @symbol(trayAction:view:), nil, &trayMessage,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12605
				__MKSMALLINT(ev->ev_arg1), theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12606
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12607
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12608
	    /* message from another process */
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12609
	    case WM_COPYDATA:
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 12610
		DPRINTF((">>> WM_COPYDATA"));
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12611
		{
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12612
		    OBJ eventData;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12613
		    void *data = (void *)(ev->ev_arg1);
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 12614
		    DPRINTFIF((__debug_WM_COPYDATA__) , (">>> WM_COPYDATA %s (%d)\n", data, ev->ev_arg2));
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 12615
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 12616
		    if (data) {
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 12617
			eventData = __MKBYTEARRAY(data, (int)ev->ev_arg2);
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 12618
			free(data);     // see winEventProcessing()
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12619
		    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12620
			eventData = nil;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12621
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12622
		    (*copyData.ilc_func)(self, @symbol(copyDataEvent:eventData:view:), nil, &copyData,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12623
				__MKSMALLINT(ev->ev_wParam), eventData, theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12624
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12625
		break;
5010
3bc0c08fdf55 CopyData event support
Claus Gittinger <cg@exept.de>
parents: 4946
diff changeset
 12626
4832
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 12627
#ifdef LATER
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12628
	    case WM_QUIT:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12629
		DPRINTF((">>> WM_QUIT_MESSAGE\n"));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12630
		(*quit.ilc_func)(self, @symbol(quitCommand:), nil, &quit);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12631
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12632
#endif
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12633
	    case WM_HSCROLL:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12634
	    case WM_VSCROLL:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12635
		{
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12636
		    int scrollCode = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12637
		    OBJ scrollCodeOrScrollCodeSymbol = nil, positionOrNil = nil;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12638
		    int pos = 0;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12639
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12640
		    scrollCode = LOWORD(ev->ev_wParam);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12641
		    scrollCodeOrScrollCodeSymbol = __MKSMALLINT(scrollCode);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12642
		    positionOrNil = nil;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12643
		    switch (scrollCode) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12644
			case SB_BOTTOM:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12645
			    scrollCodeOrScrollCodeSymbol = @symbol(SB_BOTTOM);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12646
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12647
			case SB_TOP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12648
			    scrollCodeOrScrollCodeSymbol = @symbol(SB_TOP);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12649
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12650
			case SB_ENDSCROLL:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12651
			    scrollCodeOrScrollCodeSymbol = @symbol(SB_ENDSCROLL);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12652
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12653
			case SB_LINEDOWN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12654
			    if (ev->ev_message == WM_HSCROLL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12655
				scrollCodeOrScrollCodeSymbol = @symbol(SB_LINERIGHT);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12656
			    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12657
				scrollCodeOrScrollCodeSymbol = @symbol(SB_LINEDOWN);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12658
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12659
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12660
			case SB_LINEUP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12661
			    if (ev->ev_message == WM_HSCROLL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12662
				scrollCodeOrScrollCodeSymbol = @symbol(SB_LINELEFT);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12663
			    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12664
				scrollCodeOrScrollCodeSymbol = @symbol(SB_LINEUP);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12665
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12666
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12667
			case SB_PAGEDOWN:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12668
			    if (ev->ev_message == WM_HSCROLL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12669
				scrollCodeOrScrollCodeSymbol = @symbol(SB_PAGERIGHT);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12670
			    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12671
				scrollCodeOrScrollCodeSymbol = @symbol(SB_PAGEDOWN);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12672
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12673
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12674
			case SB_PAGEUP:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12675
			    if (ev->ev_message == WM_HSCROLL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12676
				scrollCodeOrScrollCodeSymbol = @symbol(SB_PAGELEFT);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12677
			    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12678
				scrollCodeOrScrollCodeSymbol = @symbol(SB_PAGEUP);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12679
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12680
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12681
			case SB_THUMBPOSITION:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12682
			    if (ev->ev_message == WM_HSCROLL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12683
				scrollCodeOrScrollCodeSymbol = @symbol(SB_THUMBPOSITIONHORIZONTAL);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12684
			    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12685
				scrollCodeOrScrollCodeSymbol = @symbol(SB_THUMBPOSITIONVERTICAL);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12686
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12687
			    pos = HIWORD(ev->ev_wParam);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12688
			    positionOrNil = __MKSMALLINT(pos);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12689
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12690
			case SB_THUMBTRACK:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12691
			    if (ev->ev_message == WM_HSCROLL) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12692
				scrollCodeOrScrollCodeSymbol = @symbol(SB_THUMBTRACKHORIZONTAL);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12693
			    } else {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12694
				scrollCodeOrScrollCodeSymbol = @symbol(SB_THUMBTRACKVERTICAL);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12695
			    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12696
			    pos = HIWORD(ev->ev_wParam);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12697
			    positionOrNil = __MKSMALLINT(pos);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12698
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12699
			default:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12700
			    DPRINTF((">>> WM_SCROLL: unhandled scrollCode:%d %d\n", scrollCode));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12701
			    break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12702
		    }
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12703
		    NDPRINTF((">>> WM_SCROLL: %d %d\n", scrollCode, pos));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12704
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12705
		    (*win32NativeScroll.ilc_func)(self, @symbol(win32NativeScroll:position:view:),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12706
					nil, &win32NativeScroll,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12707
					scrollCodeOrScrollCodeSymbol,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12708
					positionOrNil,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12709
					theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12710
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12711
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12712
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12713
	    case WM_DRAWITEM:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12714
		{
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12715
		    NDPRINTF((">>> WM_DRAWITEM: wParam: %x\n", ev->ev_wParam));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12716
		    (*win32DrawItem.ilc_func)(self, @symbol(win32DrawItem:view:),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12717
					nil, &win32DrawItem,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12718
					__MKSMALLINT(ev->ev_wParam),
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12719
					theView);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12720
		}
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12721
		break;
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12722
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12723
	    default:
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12724
		UNHANDLED_EVENT_PRINTF(("WinWorkstat [info]: >>> unhandled event: %x\n", ev->ev_message));
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12725
		break;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12726
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12727
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12728
    ^ true
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12729
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12730
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12731
dispatchPendingEvents
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12732
    "central event handling method for modal operation.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12733
     (i.e. this is now only used in the modal debugger)
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12734
     Dispatch any pending events; return when no more are pending.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12735
     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
 12736
     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
 12737
     we only handle exposes until the graphicsExpose arrives.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12738
     Other systems may not need such a kludge"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12739
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12740
    [self eventPendingWithSync:false] whileTrue:[
4440
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12741
	(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
 12742
	    AbortOperationRequest handle:[:ex |
4440
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12743
		ex return
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12744
	    ] do:[
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12745
		self dispatchLastEvent.
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12746
		"/ multi-screen config: give others a chance
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12747
		"/ (needed because we run at high (non-timesliced) prio)
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12748
		Processor yield.
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12749
	    ]
ec0be9612eca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4439
diff changeset
 12750
	].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12751
    ]
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12752
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12753
    "Modified: 19.8.1997 / 17:11:18 / cg"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12754
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12755
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12756
disposeEventsWithMask:aMask for:aWindowIdOrNil
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12757
    "dispose (throw away) specific events. If aWindowId is nil,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12758
     events matching the mask are thrown away regardless of which
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12759
     view they are for. Otherwise, only matching events for that
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12760
     view are flushed."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12761
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12762
%{  /* NOCONTEXT */
2733
5af2417bc450 pass x/y with mouseWheel event
Claus Gittinger <cg@exept.de>
parents: 2732
diff changeset
 12763
   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
 12764
   RETURN ( self );
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 12765
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12766
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12767
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12768
eventMaskFor:anEventSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12769
    "return the eventMask bit-constant corresponding to an event symbol"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12770
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12771
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12772
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12773
    int m = 0;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12774
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12775
    if (anEventSymbol == @symbol(keyPress)) m = KeyPressMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12776
    else if (anEventSymbol == @symbol(keyRelease)) m = KeyReleaseMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12777
    else if (anEventSymbol == @symbol(buttonPress)) m = ButtonPressMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12778
    else if (anEventSymbol == @symbol(buttonRelease)) m = ButtonReleaseMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12779
    else if (anEventSymbol == @symbol(buttonMotion)) m = ButtonMotionMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12780
    else if (anEventSymbol == @symbol(pointerMotion)) m = PointerMotionMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12781
    else if (anEventSymbol == @symbol(expose)) m = ExposureMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12782
    else if (anEventSymbol == @symbol(focusChange)) m = FocusChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12783
    else if (anEventSymbol == @symbol(enter)) m = EnterWindowMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12784
    else if (anEventSymbol == @symbol(leave)) m = LeaveWindowMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12785
    else if (anEventSymbol == @symbol(keymapState)) m = KeymapStateMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12786
    else if (anEventSymbol == @symbol(visibilityChange)) m = VisibilityChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12787
    else if (anEventSymbol == @symbol(structureNotify)) m = StructureNotifyMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12788
    else if (anEventSymbol == @symbol(resizeRedirect)) m = ResizeRedirectMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12789
    else if (anEventSymbol == @symbol(propertyChange)) m = PropertyChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12790
    else if (anEventSymbol == @symbol(colormapChange)) m = ColormapChangeMask;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12791
    RETURN (__MKSMALLINT(m));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12792
%}
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
eventPending
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12796
    "return true, if any event is pending.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12797
     This looks for both the internal queue and the display connection."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12798
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12799
    ^ self eventPendingWithSync:false
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12800
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12801
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12802
eventPending:anEventSymbol for:aWindowIdOrNil
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12803
    "return true, if a specific event is pending"
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12804
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12805
    ^ self eventsPending:(self eventMaskFor:anEventSymbol) for:aWindowIdOrNil withSync:false
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
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12808
eventPendingWithSync:doSync
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12809
    "return true, if any event is pending.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12810
     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
 12811
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12812
    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
 12813
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 12814
%{
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12815
    if (hasEventQueued()) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12816
	RETURN (true);
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 12817
    }
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 12818
%}.
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12819
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12820
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12821
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12822
eventQueued
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12823
    "return true, if any event is queued"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12824
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12825
    ^ self eventQueuedAlready
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12826
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12827
    "Created: 12.12.1995 / 21:43:00 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12828
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12829
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12830
eventQueuedAlready
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12831
    "return true, if any event is queued internally.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12832
     (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
 12833
      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
 12834
      the display connection)."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12835
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 12836
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12837
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
 12838
    DDDPRINTF(("peek q - "));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12839
    if (hasEventQueued()) {
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
 12840
	DDDPRINTF(("true\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12841
	RETURN (true);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12842
    }
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
 12843
    DDDPRINTF(("false\n"));
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12844
%}.
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12845
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12846
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12847
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12848
eventsPending:anEventMask for:aWindowIdOrNil withSync:doSync
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
 12849
    "return true, if any of the masked events is pending.
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
 12850
     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
 12851
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12852
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12853
6165
461f6b3a23f7 fix (I hope) window positioning (maximizing)
Claus Gittinger <cg@exept.de>
parents: 6067
diff changeset
 12854
    DDDPRINTF(("eventsPending mask %x - not implemented\n", __intVal(anEventMask)));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12855
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12856
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12857
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12858
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12859
exposeEventPendingFor:aWindowIdOrNil withSync:doSync
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12860
    "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
 12861
     or any view (if the arg is nil).
1705
0be9e1cae5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1685
diff changeset
 12862
     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
 12863
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12864
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12865
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12866
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12867
getEventFor:aViewIdOrNil withMask:eventMask
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12868
    "read next event - put into local eventBuffer.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 12869
     If aViewIdOrNil is nil, events for any view are fetched;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12870
     otherwise only events for that specific view will be fetched.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12871
     Returns true, if there was an event, false otherwise."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12872
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 12873
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12874
    HWND win, wWanted;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12875
    int evMask;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12876
    OBJ eB;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12877
    struct queuedEvent *ev;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12878
    struct queuedEvent *qev;
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12879
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12880
    eB = __INST(eventBuffer);
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12881
    if (! __isByteArray(eB)) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 12882
	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
 12883
	/* RETURN (false); */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12884
    } else {
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12885
	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
 12886
	ev->ev_message = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12887
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12888
	if (__isSmallInteger(eventMask)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12889
	    evMask = __intVal(eventMask);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12890
	} else {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12891
	    evMask = ~0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12892
	}
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12893
	if (__isExternalAddress(aViewIdOrNil)) {
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12894
	    wWanted = _HWNDVal(aViewIdOrNil);
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12895
	} else{
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12896
	    wWanted = 0;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 12897
	}
2736
6e79e8f5ae7e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2733
diff changeset
 12898
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12899
	do { /* only to allow continue */
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12900
	    if (deqEvent(ev, wWanted, evMask)) {
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 12901
#ifdef COMPRESS_WINDOWPOSCHANGED
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12902
		if ((ev->ev_hWnd == lastPos_win)
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12903
		 && (ev->ev_message == WM_WINDOWPOSCHANGED)
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12904
		 && ((ev->ev_x != lastPos_x)
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12905
		     || (ev->ev_y != lastPos_y)
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12906
		     || (ev->ev_w != lastPos_w)
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12907
		     || (ev->ev_h != lastPos_h))) {
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12908
		    /*
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 12909
		     * ignore intermediate resize events
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 12910
		     * (that event is an intermediate one, because the peek-values
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 12911
		     *  have already been updated for another event)
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12912
		     */
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12913
		    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
 12914
				  ev->ev_x, lastPos_x,
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12915
				  ev->ev_y, lastPos_y,
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12916
				  ev->ev_w, lastPos_w,
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 12917
				  ev->ev_h, lastPos_h ));
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12918
		    continue;
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12919
		}
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 12920
#endif
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12921
		RETURN ( true );
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12922
	    }
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 12923
	} while (0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12924
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12925
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12926
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12927
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12928
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12929
handleAllEvents
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12930
    "from now on, handle any kind of event.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12931
     Always with win32."
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12932
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12933
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12934
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12935
handleExposeOnlyFor:aView
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12936
    "from now on, handle expose events only.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12937
     Never with win32."
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 12938
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12939
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 12940
5958
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12941
registerHotKeyForWindow:aDrawableId withId:anId modifiers:aModifier virtualKeyCode:aVirtualKeyCode
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12942
    "Defines a system-wide hot key."
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12943
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12944
%{  /* NOCONTEXT */
5958
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12945
    static registerHotKeyInfo rhki;
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12946
    HWND hWnd = NULL;
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12947
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12948
    if (__isExternalAddress(aDrawableId)) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12949
	hWnd = _HWNDVal(aDrawableId);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12950
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12951
	if (! hWnd) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12952
	    RETURN (false);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12953
	}
5958
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12954
    } else {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12955
	RETURN (false);
5958
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12956
    }
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12957
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12958
    rhki.hwnd       = hWnd;
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12959
    rhki.hotKeyId   = __intVal(anId);
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12960
    rhki.modifier   = __intVal(aModifier);
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12961
    rhki.virtualKey = __intVal(aVirtualKeyCode);
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12962
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12963
    if (PostThreadMessage(_dispatchThreadId, WM_THREAD_REGISTERHOTKEY, 0, (INT)(&rhki)) == FALSE) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12964
	console_fprintf(stderr, "WinWorkstation [error]: oops - PostThreadMessage(%x) failed in registerHotKeyForWindow: err=%d\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12965
					_dispatchThreadId, GetLastError() );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12966
	RETURN (false);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 12967
    }
5958
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12968
%}.
22d01fc6a7ff class definition
ab
parents: 5955
diff changeset
 12969
    ^ true
5955
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12970
!
b93044c7d33b Add support of Hotkeys. Add WM_HOTKEY to dispatchThread
ab
parents: 5943
diff changeset
 12971
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12972
setEventMask:aMask in:aWindowId
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 12973
    "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
 12974
     is the bitwise-or of the eventMask bits (see 'eventMaskFor:')"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 12975
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12976
%{  /* NOCONTEXT */
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12977
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12978
    if (__isExternalAddress(aWindowId)
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12979
     && __isSmallInteger(aMask)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12980
	HWND hWnd = _HWNDVal(aWindowId);
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12981
	int mask = __intVal(aMask);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12982
	localWindowInfo *lI;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12983
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 12984
	lI = GETLOCALWINDOWINFOPTR(hWnd);
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 12985
	if (lI) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12986
#ifdef DEBUGMASK
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12987
	    PRINTF(("new eventMask %x\n",mask));
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12988
	    printMask(mask);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12989
#endif
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12990
	    lI->eventMask = mask;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 12991
	    RETURN ( self );
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12992
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12993
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12994
%}.
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 12995
    self primitiveFailed
5964
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 12996
!
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 12997
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 12998
unregisterHotKeyForWindow:aDrawableId withId:anId
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 12999
    "Defines a system-wide hot key."
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13000
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13001
%{  /* NOCONTEXT */
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13002
    static registerHotKeyInfo rhki;
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13003
    HWND hWnd = NULL;
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13004
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13005
    if (__isExternalAddress(aDrawableId)) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 13006
	hWnd = _HWNDVal(aDrawableId);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 13007
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 13008
	if (! hWnd) {
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 13009
	    RETURN (false);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 13010
	}
5964
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13011
    } else {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 13012
	RETURN (false);
5964
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13013
    }
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13014
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13015
    rhki.hwnd       = hWnd;
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13016
    rhki.hotKeyId   = __intVal(anId);
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13017
    rhki.modifier   = 0;
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13018
    rhki.virtualKey = 0;
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13019
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13020
    if (PostThreadMessage(_dispatchThreadId, WM_THREAD_UNREGISTERHOTKEY, 0, (INT)(&rhki)) == FALSE) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 13021
	console_fprintf(stderr, "WinWorkstation [error]: oops - PostThreadMessage(%x) failed in unregisterHotKeyForWindow: err=%d\n",
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 13022
					_dispatchThreadId, GetLastError() );
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 13023
	RETURN (false);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 13024
    }
5964
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13025
%}.
7c901cc6c8ef support of hotkey events (register/unregister)
ab
parents: 5958
diff changeset
 13026
    ^ true
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13027
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13028
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13029
!WinWorkstation methodsFor:'event sending'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13030
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13031
sendKeyOrButtonEvent:typeSymbol x:xPos y:yPos keyOrButton:keySymCodeOrButtonNr state:stateMask toViewId:targetIdArg
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13032
    "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
 13033
     TypeSymbol must be one of: #keyPress, #keyRelease, #buttonPress , #buttonRelease.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13034
     For buttonEvents, the keySymCodeOrButtonNr must be the buttons number (1, 2 ...);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13035
     for key events, it can be either a symbol (as listen in X's keySyms)
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13036
     or a numeric keysym code or a character.
8013
c88e98d6690e #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8012
diff changeset
 13037
     If state is nil, the modifier bits (shift & control)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13038
     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
 13039
     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
 13040
     (not very user friendly)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13041
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13042
    |ok xLog yLog targetId|
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13043
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13044
    (xPos notNil and:[yPos notNil]) ifTrue:[
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13045
	"/ scale 0..width to 0..16rFFFF
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13046
	xLog := xPos * 16rFFFF // self width.
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13047
	yLog := yPos * 16rFFFF // self height.
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13048
    ].
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13049
    (targetIdArg notNil and:[targetIdArg ~= self rootWindowId]) ifTrue:[
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13050
	targetId := targetIdArg.
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13051
    ].
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13052
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13053
    ok := false.
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13054
%{
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13055
    BOOL rslt;
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13056
    HWND hWnd = 0;
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13057
    UINT msg;
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13058
    WPARAM wParam = 0;
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13059
    LPARAM lParam = 0;
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13060
    DWORD dwFlags = 0;
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13061
    int _isMouseEvent = 0;
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13062
    int _isKeyEvent = 0;
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13063
    int _keyCodeOrButtonNr = -1;
8014
9b3128e00e64 #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8013
diff changeset
 13064
    int _shifted = 0;
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13065
    int _xP = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13066
    int _yP = 0;
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13067
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13068
    if (__isExternalAddress(targetId)) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13069
	hWnd = _HWNDVal(targetId);
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13070
    }
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13071
    if (__isSmallInteger(keySymCodeOrButtonNr)) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13072
	_keyCodeOrButtonNr = __intVal(keySymCodeOrButtonNr);
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13073
    } else {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13074
	if (__isCharacter(keySymCodeOrButtonNr)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13075
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13076
	    _keyCodeOrButtonNr = __intVal(__characterVal(keySymCodeOrButtonNr));
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 13077
	    DPRINTF(("code: %d (#%02x)\n", _keyCodeOrButtonNr, _keyCodeOrButtonNr));
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13078
	    if ((_keyCodeOrButtonNr >= 'a') && (_keyCodeOrButtonNr <= 'z')) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13079
		_keyCodeOrButtonNr -= 0x20;
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 13080
		DPRINTF(("code: %d (#%02x)\n", _keyCodeOrButtonNr, _keyCodeOrButtonNr));
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13081
	    } else {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13082
		if ((_keyCodeOrButtonNr >= 'A') && (_keyCodeOrButtonNr <= 'Z')) {
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 13083
		    DPRINTF(("code: shifted %d (#%02x)\n", _keyCodeOrButtonNr, _keyCodeOrButtonNr));
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13084
		    _shifted = 1;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13085
		}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13086
	    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13087
	} else if (keySymCodeOrButtonNr == @symbol(Return)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13088
	    _keyCodeOrButtonNr = VK_RETURN;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13089
	} else if (keySymCodeOrButtonNr == @symbol(Enter)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13090
	    _keyCodeOrButtonNr = VK_RETURN;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13091
	} else if (keySymCodeOrButtonNr == @symbol(BackSpace)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13092
	    _keyCodeOrButtonNr = VK_BACK;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13093
	} else if (keySymCodeOrButtonNr == @symbol(Tab)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13094
	    _keyCodeOrButtonNr = VK_TAB;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13095
	} else if (keySymCodeOrButtonNr == @symbol(Shift)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13096
	    _keyCodeOrButtonNr = VK_SHIFT;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13097
	} else if (keySymCodeOrButtonNr == @symbol(Ctrl)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13098
	    _keyCodeOrButtonNr = VK_CONTROL;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13099
	} else if (keySymCodeOrButtonNr == @symbol(Menu)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13100
	    _keyCodeOrButtonNr = VK_MENU;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13101
	} else if (keySymCodeOrButtonNr == @symbol(Escape)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13102
	    _keyCodeOrButtonNr = VK_ESCAPE;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13103
	} else if (keySymCodeOrButtonNr == @symbol(Space)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13104
	    _keyCodeOrButtonNr = VK_SPACE;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13105
	} else if (keySymCodeOrButtonNr == @symbol(Prior)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13106
	    _keyCodeOrButtonNr = VK_PRIOR;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13107
	} else if (keySymCodeOrButtonNr == @symbol(Next)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13108
	    _keyCodeOrButtonNr = VK_NEXT;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13109
	} else if (keySymCodeOrButtonNr == @symbol(End)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13110
	    _keyCodeOrButtonNr = VK_END;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13111
	} else if (keySymCodeOrButtonNr == @symbol(Home)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13112
	    _keyCodeOrButtonNr = VK_HOME;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13113
	} else if (keySymCodeOrButtonNr == @symbol(Left)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13114
	    _keyCodeOrButtonNr = VK_LEFT;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13115
	} else if (keySymCodeOrButtonNr == @symbol(Right)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13116
	    _keyCodeOrButtonNr = VK_RIGHT;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13117
	} else if (keySymCodeOrButtonNr == @symbol(Down)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13118
	    _keyCodeOrButtonNr = VK_DOWN;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13119
	} else if (keySymCodeOrButtonNr == @symbol(Up)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13120
	    _keyCodeOrButtonNr = VK_UP;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13121
	} else if (keySymCodeOrButtonNr == @symbol(Insert)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13122
	    _keyCodeOrButtonNr = VK_INSERT;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13123
	} else if (keySymCodeOrButtonNr == @symbol(Delete)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13124
	    _keyCodeOrButtonNr = VK_DELETE;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13125
	} else if (keySymCodeOrButtonNr == @symbol(Help)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13126
	    _keyCodeOrButtonNr = VK_HELP;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13127
	} else if (keySymCodeOrButtonNr == @symbol(F1)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13128
	    _keyCodeOrButtonNr = VK_F1;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13129
	} else if (keySymCodeOrButtonNr == @symbol(F2)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13130
	    _keyCodeOrButtonNr = VK_F2;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13131
	} else if (keySymCodeOrButtonNr == @symbol(F3)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13132
	    _keyCodeOrButtonNr = VK_F3;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13133
	} else if (keySymCodeOrButtonNr == @symbol(F4)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13134
	    _keyCodeOrButtonNr = VK_F4;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13135
	} else if (keySymCodeOrButtonNr == @symbol(F5)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13136
	    _keyCodeOrButtonNr = VK_F5;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13137
	} else if (keySymCodeOrButtonNr == @symbol(F6)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13138
	    _keyCodeOrButtonNr = VK_F6;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13139
	} else if (keySymCodeOrButtonNr == @symbol(F7)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13140
	    _keyCodeOrButtonNr = VK_F7;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13141
	} else if (keySymCodeOrButtonNr == @symbol(F8)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13142
	    _keyCodeOrButtonNr = VK_F8;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13143
	} else if (keySymCodeOrButtonNr == @symbol(F9)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13144
	    _keyCodeOrButtonNr = VK_F9;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13145
	} else if (keySymCodeOrButtonNr == @symbol(F10)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13146
	    _keyCodeOrButtonNr = VK_F10;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13147
	} else if (keySymCodeOrButtonNr == @symbol(F11)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13148
	    _keyCodeOrButtonNr = VK_F11;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13149
	} else if (keySymCodeOrButtonNr == @symbol(F12)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13150
	    _keyCodeOrButtonNr = VK_F12;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13151
	} else {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13152
	    console_printf("bad key\n");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13153
	    goto getOutOfHere;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13154
	}
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13155
    }
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13156
    if (__isSmallInteger(xLog)) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13157
	_xP = __intVal(xLog);
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13158
    }
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13159
    if (__isSmallInteger(yLog)) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13160
	_yP = __intVal(yLog);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13161
    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13162
    lParam = _xP | (_yP << 16);
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13163
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13164
    if (typeSymbol == @symbol(buttonPress)) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13165
	_isMouseEvent = 1;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13166
	switch (_keyCodeOrButtonNr) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13167
	    case 1:
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13168
		msg = WM_LBUTTONDOWN;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13169
		wParam = MK_LBUTTON;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13170
		dwFlags = MOUSEEVENTF_LEFTDOWN;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13171
		break;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13172
	    case 2:
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13173
		msg = WM_MBUTTONDOWN;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13174
		wParam = MK_MBUTTON;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13175
		dwFlags = MOUSEEVENTF_MIDDLEDOWN;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13176
		break;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13177
	    case 3:
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13178
		msg = WM_RBUTTONDOWN;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13179
		wParam = MK_RBUTTON;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13180
		dwFlags = MOUSEEVENTF_RIGHTDOWN;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13181
		break;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13182
	    default:
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13183
		console_printf("bad button\n");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13184
		goto getOutOfHere;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13185
	}
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13186
    } else if (typeSymbol == @symbol(buttonRelease)) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13187
	_isMouseEvent = 1;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13188
	switch (_keyCodeOrButtonNr) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13189
	    case 1:
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13190
		msg = WM_LBUTTONUP;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13191
		dwFlags = MOUSEEVENTF_LEFTUP;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13192
		break;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13193
	    case 2:
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13194
		msg = WM_MBUTTONUP;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13195
		dwFlags = MOUSEEVENTF_MIDDLEUP;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13196
		break;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13197
	    case 3:
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13198
		msg = WM_RBUTTONUP;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13199
		dwFlags = MOUSEEVENTF_RIGHTUP;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13200
		break;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13201
	    default:
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13202
		console_printf("bad button\n");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13203
		goto getOutOfHere;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13204
	}
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13205
    } else if ((typeSymbol == @symbol(keyPress)) || (typeSymbol == @symbol(keyRelease))) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13206
	dwFlags = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13207
	if (typeSymbol == @symbol(keyRelease)) dwFlags = KEYEVENTF_KEYUP;
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13208
    } else {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13209
	console_printf("bad typeSymbol\n");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13210
	goto getOutOfHere;
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13211
    }
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13212
    if (_isMouseEvent) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13213
	if ((xPos == nil) || (yPos == nil)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13214
	    console_printf("bad x/y\n");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13215
	    goto getOutOfHere;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13216
	}
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13217
    }
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13218
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13219
    if (hWnd == 0) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13220
	// send to screen
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13221
	if ((xPos != nil) && (yPos != nil)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13222
	    mouse_event(MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE, _xP, _yP, 0, NULL);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13223
	}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13224
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13225
	if (_isMouseEvent) {
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 13226
	    DPRINTF(("mouse %08x %d/%d\n", dwFlags | MOUSEEVENTF_ABSOLUTE, _xP, _yP));
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13227
	    mouse_event(dwFlags | MOUSEEVENTF_ABSOLUTE, _xP, _yP, 0, NULL);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13228
	} else {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13229
	    if (_shifted) {
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 13230
		DPRINTF(("shifted keybd #%08x %d (#%02x)\n", dwFlags, _keyCodeOrButtonNr, _keyCodeOrButtonNr));
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13231
		keybd_event( VK_SHIFT, 0 /* _keyCodeOrButtonNr */, 0, 0);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13232
		keybd_event( _keyCodeOrButtonNr, 0 /* _keyCodeOrButtonNr */, dwFlags, 0);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13233
		keybd_event( VK_SHIFT, 0 /* _keyCodeOrButtonNr */, KEYEVENTF_KEYUP, 0);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13234
	    } else {
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 13235
		DPRINTF(("keybd #%08x %d (#%02x)\n", dwFlags, _keyCodeOrButtonNr, _keyCodeOrButtonNr));
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13236
		keybd_event( _keyCodeOrButtonNr, 0 /* _keyCodeOrButtonNr */, dwFlags, 0);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13237
	    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13238
	}
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13239
    } else {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13240
	rslt = PostMessage(hWnd, msg, wParam, lParam);
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13241
    }
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13242
    ok = true;
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13243
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13244
getOutOfHere: ;
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13245
%}.
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13246
    ok ifFalse:[
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13247
	'WinWorkstation [warning]: sendKeyOrButtonEvent unimplemented' infoPrintCR.
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 13248
	self primitiveFailed.
8012
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13249
    ].
713308a90e2d #FEATURE by expecco
Claus Gittinger <cg@exept.de>
parents: 8011
diff changeset
 13250
    ^ ok
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13251
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13252
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13253
!WinWorkstation methodsFor:'font stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13254
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13255
createFontFor:aFontName
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13256
    "a basic method for font allocation; this method allows
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13257
     any font to be aquired (even those not conforming to
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13258
     standard naming conventions, such as cursor, fixed or k14)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13259
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13260
%{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13261
    HGDIOBJ hFont;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13262
    char *fn;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13263
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 13264
    if (__isStringLike(aFontName)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13265
	fn = __stringVal(aFontName);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13266
	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
 13267
	    hFont = GetStockObject(ANSI_FIXED_FONT);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13268
	} 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
 13269
	    hFont = GetStockObject(ANSI_VAR_FONT);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13270
	} else if ((strcmp(fn, "system") == 0) || (strcmp(fn, "SYSTEM_FONT") == 0)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13271
	    hFont = GetStockObject(SYSTEM_FONT);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13272
	} 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
 13273
	    hFont = GetStockObject(SYSTEM_FIXED_FONT);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13274
	} 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
 13275
	    hFont = GetStockObject(DEVICE_DEFAULT_FONT);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13276
	} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13277
	    hFont = GetStockObject(ANSI_FIXED_FONT);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13278
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13279
	if (hFont) {
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 13280
	    DPRINTF(("createFontFor:%s -> %x\n", fn, hFont));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13281
	    RETURN ( __MKOBJ(hFont) );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13282
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13283
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13284
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13285
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13286
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13287
5581
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 13288
encodingOf:fontId
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 13289
    "return the encoding of the font"
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 13290
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 13291
    ^ (self fontMetricsOf:fontId) encoding
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 13292
!
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 13293
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 13294
fontDescriptionFromLogicalFontInfoArray:anInfoArray
5649
50c68e749917 changed: #fontDescriptionFromLogicalFontInfoArray:
Claus Gittinger <cg@exept.de>
parents: 5648
diff changeset
 13295
    |fntDescr family face style logicalSize pointSize encoding|
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 13296
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13297
    family := anInfoArray at:16.
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13298
    face   := anInfoArray at:6.
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13299
    style  := anInfoArray at:15.
3972
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13300
    logicalSize   := anInfoArray at:1.
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13301
    encoding := anInfoArray at:17.
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 13302
3972
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13303
    logicalSize := logicalSize abs.
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13304
    "/ convert from device to point size
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13305
    pointSize := (logicalSize / self getLogicalPixelSizeY * 72.0).
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 13306
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 13307
    fntDescr := FontDescription
5650
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 13308
		    family:family
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 13309
		    face:face
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 13310
		    style:style
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 13311
		    size:pointSize
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 13312
		    sizeUnit:#pt
657ac8149dc3 release hBitmap (possible leak in screenShot)
Claus Gittinger <cg@exept.de>
parents: 5649
diff changeset
 13313
		    encoding:encoding.
5198
a95b6a853a3b changed #pixelSize
Claus Gittinger <cg@exept.de>
parents: 5190
diff changeset
 13314
    fntDescr setPixelSize:logicalSize.
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 13315
    ^ fntDescr.
5645
760a83be3f61 changed: #fontDescriptionFromLogicalFontInfoArray:
Claus Gittinger <cg@exept.de>
parents: 5641
diff changeset
 13316
5649
50c68e749917 changed: #fontDescriptionFromLogicalFontInfoArray:
Claus Gittinger <cg@exept.de>
parents: 5648
diff changeset
 13317
    "Modified: / 09-11-2010 / 13:00:18 / cg"
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 13318
!
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 13319
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13320
fontMetricsOf:fontId
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13321
    "return a fonts metrics info object"
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13322
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13323
    |rawData info|
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13324
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13325
    rawData := Array new:15.
3481
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 13326
    (self primFontMetricsOf:fontId intoArray:rawData) isNil ifTrue:[
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13327
	self primitiveFailed.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13328
	^ self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13329
    ].
3481
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 13330
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13331
    info := DeviceWorkstation::DeviceFontMetrics new.
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13332
    info
3481
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 13333
      ascent:(rawData at:1)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 13334
      descent:(rawData at:2)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 13335
      maxAscent:(rawData at:3)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 13336
      maxDescent:(rawData at:4)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 13337
      minWidth:(rawData at:5)
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 13338
      maxWidth:(rawData at:6)
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13339
      avgWidth:(rawData at:7)
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13340
      minCode:(rawData at:8)
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13341
      maxCode:16rFFFF "(rawData at:9)"
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13342
      direction:nil
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13343
      encoding:(rawData at:11).
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13344
    ^ info
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13345
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13346
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13347
fontsInFamily:aFamilyName face:aFaceName filtering:filter
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13348
    "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
 13349
     On WinWorkStations there is curently Face
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13350
     But only thise matching filter (if nonNil)."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13351
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13352
    |allFonts fonts|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13353
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13354
    allFonts := self listOfAvailableFonts.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13355
    allFonts isNil ifTrue:[^ nil].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13356
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13357
    fonts := Set new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13358
    allFonts do:[:fntDescr |
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13359
	(aFamilyName sameAs:(fntDescr family)) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13360
	    (filter isNil or:[filter value:fntDescr]) ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13361
		fonts add:fntDescr
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13362
	    ]
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13363
	]
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13364
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13365
    ^ fonts
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13366
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13367
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13368
getAvailableFontsMatching:pattern
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13369
    "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
 13370
    self shouldImplement.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13371
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13372
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13373
5910
da3bcd680026 added: #getDefaultFontWithEncoding:
Stefan Vogel <sv@exept.de>
parents: 5867
diff changeset
 13374
getDefaultFontWithEncoding:encoding
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13375
    "return a default font id - used when class Font cannot
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13376
     find anything usable"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13377
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13378
     ^ self createFontFor:'fixed'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13379
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13380
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13381
getFontWithFamily:familyString face:faceString
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13382
	    style:styleArgString size:sizeArg sizeUnit:sizeUnitArg
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13383
	    encoding:encoding
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13384
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13385
    "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
 13386
     font."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13387
5583
4cbf0d98dba1 changed:
Stefan Vogel <sv@exept.de>
parents: 5581
diff changeset
 13388
    |styleString theName theId xlatedStyle id spacing pxSize ptSize encodingSym|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13389
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13390
    styleString := styleArgString.
5583
4cbf0d98dba1 changed:
Stefan Vogel <sv@exept.de>
parents: 5581
diff changeset
 13391
    encoding isEmptyOrNil ifTrue:[
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13392
	encodingSym := #'ms-default' "/ encoding.
5583
4cbf0d98dba1 changed:
Stefan Vogel <sv@exept.de>
parents: 5581
diff changeset
 13393
    ] ifFalse:[
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13394
	encodingSym := encoding asLowercase asSymbol.
5583
4cbf0d98dba1 changed:
Stefan Vogel <sv@exept.de>
parents: 5581
diff changeset
 13395
    ].
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13396
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13397
    "special: if face is nil, allow access to X-fonts"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13398
    faceString isNil ifTrue:[
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13399
	sizeArg notNil ifTrue:[
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13400
	    theName := familyString , '-' , sizeArg printString
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13401
	] ifFalse:[
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13402
	    theName := familyString
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13403
	].
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13404
	theName notNil ifTrue:[
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13405
	    theId := self createFontFor:theName.
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13406
	].
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13407
	theId isNil ifTrue:[
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13408
	    theId := self getDefaultFontWithEncoding:encoding
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13409
	].
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13410
	^ theId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13411
    ].
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
    "/ spacing other than 'normal' is contained as last component
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13414
    "/ in style
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13415
    styleString notNil ifTrue:[
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13416
	((styleString endsWith:'-narrow')
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13417
	 or:[styleString endsWith:'-semicondensed']) ifTrue:[
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13418
	    |i|
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13419
	    i := styleString lastIndexOf:$-.
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13420
	    spacing := styleString copyFrom:(i+1).
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13421
	    styleString := styleString copyTo:(i-1).
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13422
	] ifFalse:[
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13423
	    spacing := #normal.
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13424
	].
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13425
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13426
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13427
    xlatedStyle := styleString.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13428
    xlatedStyle notNil ifTrue:[
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13429
	xlatedStyle := xlatedStyle first asString
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13430
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13431
5190
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 13432
    pxSize := sizeUnitArg == #px ifTrue:[sizeArg] ifFalse:[nil].
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 13433
    ptSize := sizeUnitArg == #pt ifTrue:[sizeArg] ifFalse:[nil].
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 13434
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13435
    id := self
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13436
	    getFontWithFoundry:#*
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13437
	    family:familyString asLowercase
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13438
	    weight:faceString
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13439
	    slant:styleString "/ xlatedStyle
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13440
	    spacing:spacing
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13441
	    pixelSize:pxSize
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13442
	    size:ptSize
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13443
	    registry:#*
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13444
	    encoding:encodingSym.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13445
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13446
    id isNil ifTrue:[
5941
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13447
	id := self
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13448
		getFontWithFoundry:#*
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13449
		family:familyString asLowercase
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13450
		weight:faceString asLowercase
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13451
		slant:styleString asLowercase
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13452
		spacing:spacing
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13453
		pixelSize:pxSize
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13454
		size:ptSize
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13455
		registry:#*
23092a09b2b6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
 13456
		encoding:encodingSym.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13457
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13458
    ^ id
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13459
5587
909a0413b6a2 changed: #getFontWithFamily:face:style:size:sizeUnit:encoding:
sr
parents: 5583
diff changeset
 13460
    "Modified: / 04-07-1996 / 11:38:47 / stefan"
909a0413b6a2 changed: #getFontWithFamily:face:style:size:sizeUnit:encoding:
sr
parents: 5583
diff changeset
 13461
    "Modified: / 04-08-2010 / 18:39:02 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13462
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13463
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13464
getFontWithFoundry:foundry family:family weight:weight
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13465
	      slant:slant spacing:spc pixelSize:pixelSizeOrNil size:pointSize
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13466
	      registry:registry encoding:encodingArg
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13467
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13468
    "get the specified font, if not available, return nil.
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13469
     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
 13470
     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
 13471
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13472
     foundry:   'adobe', 'misc', 'dec', 'schumacher' ... usually '*'
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13473
     family:    'helvetica' 'courier' 'times' ...
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13474
     weight:    'bold' 'medium' 'demi' ...
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13475
     slant:     'r(oman)' 'i(talic)' 'o(blique)'
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13476
     spacing:   'narrow' 'normal' semicondensed' ... usually '*'
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13477
     pixelSize: 16,18 ... size in pixels; usually left nil
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13478
     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
 13479
     registry:  iso8859, sgi ... '*'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13480
     encoding:  vendor specific encoding (usually '*')
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13481
    "
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13482
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 13483
    "
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13484
     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
 13485
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13486
	nHeight
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13487
	nWidth
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13488
	nEscapement
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13489
	nOrientation
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13490
	fnWeight        FW_DONTCARE, FW_NORMAL, FW_MEDIUM, FW_BOLD, ...
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13491
	fdwItalic       TRUE or FALSE
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13492
	fdwUnderline    TRUE or FALSE
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13493
	fdwStrikeOut    TRUE or FALSE
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13494
	fdwCharSet      ANSI_CHARSET, UNICODE_, SYMBOL_, SHIFTJIS_,...
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13495
	fdwOutputPrecision      DEFAULT, STRING, CHAR, ...
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13496
	fdwClipPrecision        DEFAULT, CHAR, STROKE, MASK, ...
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13497
	fdwQuality      DEFAULT, DRAFT, or PROOF.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13498
	fdwPitchAndFamily
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13499
		DEFAULT, FIXED or VARIABLE pitch
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13500
		DECORATIVE, DONTCASE, MODERN, ROMAN, SCRIPT, or SWISS.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13501
	lpszFace
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13502
		Typeface Name
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13503
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13504
      These two above descriptions will be matched as follows:
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13505
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13506
	foundry   - ignored
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13507
	family    - mapped to type face name.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13508
	weight    - mapped to fnWeight
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13509
	slant     - used for style
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13510
	spacing   - NOT USED INITIALLY
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13511
	pixelSize - NOT USED INITIALLY
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13512
	size      - mapped to nHeight
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13513
	registry  - NOT USED INITIALLY
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13514
	encoding  - mapped to fdwCharSet
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13515
     "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13516
5581
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 13517
    |encoding logSize heightIsCellHeight|
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 13518
31a170b78a33 primitives expect a symbol as encoding
Stefan Vogel <sv@exept.de>
parents: 5577
diff changeset
 13519
    encoding := encodingArg asSymbol.
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13520
5171
333471dbc830 pixelSized font preps
Claus Gittinger <cg@exept.de>
parents: 5163
diff changeset
 13521
    pixelSizeOrNil notNil ifTrue:[
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13522
	logSize := pixelSizeOrNil.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13523
	heightIsCellHeight := false.
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13524
    ] ifFalse:[
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13525
	logSize := (pointSize * (self getLogicalPixelSizeY) / 72.0) rounded.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13526
	heightIsCellHeight := false.
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13527
    ].
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13528
%{
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13529
    HGDIOBJ hFont;
5188
8946ef7cf787 pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5184
diff changeset
 13530
    int nHeight, nWidth, nEscapement, nOrientation;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13531
    char* work;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13532
    char* work2;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13533
    DWORD fnWeight;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13534
    DWORD fdwItalic;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13535
    DWORD fdwUnderline;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13536
    DWORD fdwStrikeOut;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13537
    DWORD fdwCharSet;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13538
    DWORD fdwOutputPrecision;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13539
    DWORD fdwClipPrecision;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13540
    DWORD fdwQuality;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13541
    DWORD fdwPitchAndFamily;
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13542
    static char faceName[256];
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13543
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13544
/* INITIALIZE */
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13545
    strcpy( faceName, "NULL" );
3972
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13546
    nHeight   = 0;
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13547
    nWidth   = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13548
    nEscapement = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13549
    nOrientation = 0;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13550
    fnWeight = FW_NORMAL;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13551
    fdwItalic = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13552
    fdwUnderline = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13553
    fdwStrikeOut = FALSE;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13554
    fdwOutputPrecision = OUT_DEFAULT_PRECIS;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13555
    fdwClipPrecision   = CLIP_DEFAULT_PRECIS;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13556
    fdwQuality         = DEFAULT_QUALITY;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13557
    fdwPitchAndFamily  = FF_DONTCARE;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13558
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13559
    fdwCharSet   = ANSI_CHARSET;
4013
cd666b168135 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4009
diff changeset
 13560
    if ((encoding == @symbol('ms-ansi'))) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13561
	fdwCharSet   = ANSI_CHARSET;
5583
4cbf0d98dba1 changed:
Stefan Vogel <sv@exept.de>
parents: 5581
diff changeset
 13562
    } else if (encoding == @symbol('ms-default')
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13563
	       || encoding == @symbol(*)) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13564
	fdwCharSet   = DEFAULT_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13565
    } else if ((encoding == @symbol('ms-symbol'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13566
	    || (encoding == @symbol('misc-fontspecific'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13567
	fdwCharSet   = SYMBOL_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13568
    } else if ((encoding == @symbol('ms-shiftjis'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13569
	    || (encoding == @symbol('jisx0208.1983-0'))){
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13570
	fdwCharSet   = SHIFTJIS_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13571
    } else if ((encoding == @symbol('ms-gb2312'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13572
	    || (encoding == @symbol('gb2312.1980-0'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13573
	fdwCharSet   = GB2312_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13574
    } else if ((encoding == @symbol('ms-hangeul'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13575
	    || (encoding == @symbol('ksc5601.1987-0'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13576
	fdwCharSet   = HANGEUL_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13577
    } else if ((encoding == @symbol('ms-chinesebig5'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13578
	    || (encoding == @symbol('big5'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13579
	fdwCharSet   = CHINESEBIG5_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13580
    } else if (encoding == @symbol('ms-oem')) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13581
	fdwCharSet   = OEM_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13582
    } else if (encoding == @symbol('ms-johab')) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13583
	fdwCharSet   = JOHAB_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13584
    } else if ((encoding == @symbol('ms-hebrew'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13585
	    || (encoding == @symbol('ms-cp1255'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13586
	fdwCharSet   = HEBREW_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13587
    } else if ((encoding == @symbol('ms-arabic'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13588
	    || (encoding == @symbol('ms-cp1256'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13589
	fdwCharSet   = ARABIC_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13590
    } else if ((encoding == @symbol('ms-greek'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13591
	    || (encoding == @symbol('ms-cp1253'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13592
	fdwCharSet   = GREEK_CHARSET;
4009
19c9c39f286b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4002
diff changeset
 13593
    } else if ((encoding == @symbol('ms-turkish'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13594
	    || (encoding == @symbol('ms-cp1254'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13595
	fdwCharSet   = TURKISH_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13596
    } else if ((encoding == @symbol('ms-russian'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13597
	    || (encoding == @symbol('ms-cp1251'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13598
	fdwCharSet   = RUSSIAN_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13599
    } else if ((encoding == @symbol('ms-easteurope'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13600
	    || (encoding == @symbol('ms-cp1250'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13601
	fdwCharSet   = EASTEUROPE_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13602
    } else if ((encoding == @symbol('ms-baltic'))
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13603
	    || (encoding == @symbol('ms-cp1257'))) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13604
	fdwCharSet   = BALTIC_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13605
    } else if ((encoding == @symbol('ms-vietnamese'))) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13606
	fdwCharSet   = VIETNAMESE_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13607
    } else if ((encoding == @symbol('ms-thai'))) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13608
	fdwCharSet   = THAI_CHARSET;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13609
    } else if ((encoding == @symbol('ms-mac'))) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13610
	fdwCharSet   = MAC_CHARSET;
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13611
#ifdef UNICODE_CHARSET
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13612
    } else if ((encoding == @symbol('ms-unicode'))) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13613
	fdwCharSet   = UNICODE_CHARSET;
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13614
#endif
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13615
    }
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13616
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 13617
    if ( __isStringLike( family ) ) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13618
	work = __stringVal( family );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13619
	if (strcmp( work, "nil" ) != 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13620
	    strncpy( faceName, work, sizeof(faceName)-1 );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13621
	}
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13622
    }
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13623
4000
4b3439997458 encoding names changed
Claus Gittinger <cg@exept.de>
parents: 3999
diff changeset
 13624
    /* 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
 13625
    if( __isStringLike( weight ) ) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13626
	work = __stringVal( weight );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13627
	if (strcmp( work, "bold" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13628
	    fnWeight = FW_BOLD;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13629
	} else if (strcmp( work, "medium" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13630
	    fnWeight = FW_MEDIUM;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13631
	} else if (strcmp( work, "normal" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13632
	    fnWeight = FW_NORMAL;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13633
	} else if (strcmp( work, "light" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13634
	    fnWeight = FW_LIGHT;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13635
	} else if (strcmp( work, "demi" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13636
	    fnWeight = FW_LIGHT;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13637
	} else if (strcmp( work, "heavy" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13638
	    fnWeight = FW_HEAVY;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13639
	} else if (strcmp( work, "extraBold" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13640
	    fnWeight = FW_EXTRABOLD;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13641
	} else if (strcmp( work, "semiBold" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13642
	    fnWeight = FW_SEMIBOLD;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13643
	} else if (strcmp( work, "thin" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13644
	    fnWeight = FW_THIN;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13645
	} else if (strcmp( work, "extraLight" ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13646
	    fnWeight = FW_EXTRALIGHT;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13647
	}
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13648
    } else if (__isSmallInteger(weight)) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13649
	fnWeight = __intVal(weight);
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13650
    }
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13651
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13652
    if(__isSmallInteger( logSize )) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13653
	nHeight = __intVal( logSize );
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13654
    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13655
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 13656
    if (__isStringLike(slant)) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13657
	work2 = __stringVal( slant );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13658
	work  = __stringVal( slant );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13659
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13660
	if (strncmp(work2, "italic", 6) == 0)  {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13661
	    fdwItalic = TRUE;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13662
	    if ( work2[6] == '-' )
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13663
		strncpy( work, &work2[7], ( strlen( work2) - 7) );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13664
	} else {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13665
	    if (strncmp(work2, "oblique", 7) == 0)  {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13666
		fdwItalic = TRUE;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13667
		if ( work2[7] == '-' )
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13668
		    strncpy( work, &work2[8], ( strlen( work2) - 8) );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13669
	    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13670
	}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13671
	if (strncmp( work, "underline", 9 ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13672
	    fdwUnderline = TRUE;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13673
	    if( work[10] == '-' )
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13674
		strncpy( work2, &work[11], ( strlen( work ) - 10 ) );
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13675
	}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13676
	if (strncmp( work2, "strikeOut", 9 ) == 0 ) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13677
	    fdwStrikeOut = TRUE;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13678
	}
3973
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13679
    }
f24046858adc logical font handling
ca
parents: 3972
diff changeset
 13680
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13681
    DPRINTF(("CreateFont face:%s h=%d w=%d wght=%d\n",
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13682
		faceName, nHeight, nWidth, fnWeight));
5190
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 13683
6b257515cb81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5188
diff changeset
 13684
    hFont = CreateFont(
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13685
			(
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13686
			    (heightIsCellHeight == true)  ?
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13687
				nHeight : -nHeight            /* positive:cell height; negative:character height */
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13688
			),
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13689
			nWidth,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13690
			nEscapement,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13691
			nOrientation,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13692
			fnWeight,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13693
			fdwItalic,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13694
			fdwUnderline,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13695
			fdwStrikeOut,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13696
			fdwCharSet,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13697
			fdwOutputPrecision,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13698
			fdwClipPrecision,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13699
			fdwQuality,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13700
			fdwPitchAndFamily,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13701
			faceName );
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13702
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 13703
    if (hFont != NULL) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13704
	DPRINTF(("createFont: %x\n", hFont));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13705
#ifdef COUNT_RESOURCES
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13706
	__cnt_font++;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13707
	RES1PRINTF(("CreateFont %d\n", __cnt_font));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13708
#endif
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13709
	RETURN ( __MKOBJ(hFont) );
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13710
    }
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 13711
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13712
    DPRINTF(("***** ERROR createFontWithFoundry failed ERROR *****\n" ));
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13713
%}.
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13714
    ^ nil
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13715
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13716
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13717
     Display getFontWithFoundry:'*'
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13718
			 family:'courier'
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13719
			 weight:'medium'
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13720
			  slant:'r'
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13721
			spacing:nil
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13722
		      pixelSize:nil
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13723
			   size:13
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13724
		       registry:'iso8859'
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13725
		       encoding:#*
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13726
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13727
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13728
    "new NT Version: 20.2.1997 / 22:33:29 / dq"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13729
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13730
3972
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13731
getLogicalPixelSizeY
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13732
%{
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13733
    RETURN( __MKSMALLINT(__logPixelSY) );
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13734
%}
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13735
!
1536810c6a0e *** empty log message ***
ca
parents: 3971
diff changeset
 13736
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13737
listOfAvailableFonts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13738
    "return a list with all available fonts on this display.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13739
     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
 13740
     next time. The elements of the returned collection are instances of
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13741
     FontDescription."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13742
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13743
    |list typeFaceList|
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13744
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13745
    listOfFonts notNil ifTrue:[^ listOfFonts].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13746
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13747
    list := OrderedCollection new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13748
    typeFaceList := OrderedCollection new.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13749
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13750
    [
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13751
      self primEnumFontTypesInto:typeFaceList.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13752
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13753
      "/Transcript showCR:typeFaceList.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13754
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13755
      typeFaceList do:[:typeFace |
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13756
	  self primEnumFontsIn:typeFace into:list.
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13757
      ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13758
    ] valueUninterruptably.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13759
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13760
    "/ Transcript showCR:list.
2926
0f238dfe4207 italic font fix
Claus Gittinger <cg@exept.de>
parents: 2908
diff changeset
 13761
    listOfFonts := OrderedCollection new.
0f238dfe4207 italic font fix
Claus Gittinger <cg@exept.de>
parents: 2908
diff changeset
 13762
    list do:[:anInfoArray |
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13763
	| fntDescr italicFontDescr |
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13764
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13765
	fntDescr := self fontDescriptionFromLogicalFontInfoArray:anInfoArray.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13766
	listOfFonts add:fntDescr.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13767
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13768
	"/ manually generate italic version (any font can be made italic here)
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13769
	(fntDescr style startsWith:'roman') ifTrue:[
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13770
	    italicFontDescr := FontDescription
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13771
			    family:fntDescr family
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13772
			    face:fntDescr face
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13773
			    style:('italic' , (fntDescr style copyFrom:'roman' size+1))
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13774
			    size:fntDescr size
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13775
			    encoding:fntDescr encoding.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13776
	    listOfFonts add:italicFontDescr.
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13777
	].
2926
0f238dfe4207 italic font fix
Claus Gittinger <cg@exept.de>
parents: 2908
diff changeset
 13778
    ].
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 13779
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13780
    ^ listOfFonts
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13781
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13782
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13783
     Display listOfAvailableFonts.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13784
     Display getAvailableFontsMatching:'*'.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13785
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13786
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13787
    "Modified: 27.9.1995 / 10:54:47 / stefan"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13788
    "Modified: 17.4.1996 / 15:27:57 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13789
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13790
5175
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13791
pixelSizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filterBlock
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13792
    "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
 13793
     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
 13794
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13795
    |sizes|
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13796
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13797
    sizes := super pixelSizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filterBlock.
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13798
    (sizes notNil and:[sizes includes:0]) ifTrue:[
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13799
	"special: size 0 means:
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13800
	 there are scaled versions in all sizes available"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13801
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 13802
	^ #(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
 13803
    ].
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13804
    ^ sizes
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13805
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13806
    "
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13807
     Display pixelSizesInFamily:'courier' face:'bold' style:'roman'
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13808
    "
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13809
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13810
    "Created: 27.2.1996 / 01:38:15 / cg"
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13811
!
e45a5033e9ac pixel size support
Claus Gittinger <cg@exept.de>
parents: 5173
diff changeset
 13812
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13813
primEnumFontTypesInto:typeFaceList
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13814
%{
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13815
    if (__tmpDC) {
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13816
#ifdef USE_EnumFontFamiliesEx
7613
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
 13817
	EnumFontFamiliesEx( __tmpDC, NULL, EnumFPTypeFaceProc, (INT)&typeFaceList);
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
 13818
#else
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
 13819
	EnumFontFamilies( __tmpDC, NULL, EnumFPTypeFaceProc, (INT)&typeFaceList);
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13820
#endif
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13821
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13822
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13823
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13824
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 13825
primEnumFontsIn:typeFace into:fontList
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13826
%{
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13827
    char *cp;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13828
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 13829
    if (__isStringLike(typeFace)) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13830
	if (__tmpDC) {
3995
ceac5815ea42 font stuff
ca
parents: 3976
diff changeset
 13831
#ifdef USE_EnumFontFamiliesEx
7614
3c353f6799d5 fix prev change
Stefan Vogel <sv@exept.de>
parents: 7613
diff changeset
 13832
	    EnumFontFamiliesEx(__tmpDC, __stringVal(typeFace), EnumFontsProc, (INT)&fontList);
3c353f6799d5 fix prev change
Stefan Vogel <sv@exept.de>
parents: 7613
diff changeset
 13833
#else
3c353f6799d5 fix prev change
Stefan Vogel <sv@exept.de>
parents: 7613
diff changeset
 13834
	    EnumFontFamilies(__tmpDC, __stringVal(typeFace), EnumFontsProc, (INT)&fontList);
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13835
#endif
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13836
	}
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 13837
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13838
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13839
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13840
3481
6a46fa2a728b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3480
diff changeset
 13841
primFontMetricsOf:fontId intoArray:rawData
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13842
    "evaluate aBlock, passing a fonts metrics as arguments.
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13843
     fill passed array as:
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13844
      ascent     -> (data at:1)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13845
      descent    -> (data at:2)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13846
      maxAscent  -> (data at:3)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13847
      maxDescent -> (data at:4)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13848
      minWidth   -> (data at:5)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13849
      maxWidth   -> (data at:6)
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13850
      avgWidth   -> (data at:7).
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13851
      minChar    -> (data at:8).
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13852
      maxChar    -> (data at:9).
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13853
      defaultChar-> (data at:10).
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13854
      charSet    -> (data at:11).
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13855
"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13856
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 13857
%{
3480
541ef52df2b8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3470
diff changeset
 13858
    if (__isExternalAddress(fontId)
6067
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 13859
     && __isArray(rawData)
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 13860
     && (__arraySize(rawData) >= 11)) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13861
	SIZE size;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13862
	int avgWidth;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13863
	HGDIOBJ hFont;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13864
	HGDIOBJ prevFont;
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 13865
	// TEXTMETRIC tmet;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 13866
	TEXTMETRICW tmet;
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13867
	OBJ t;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13868
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13869
	hFont = _HGDIOBJVal(fontId);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13870
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13871
	/*
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13872
	 * temporarily set this font in the tmpDC (root-) context
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13873
	 */
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13874
#ifdef CACHE_LAST_TMP_FONT
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13875
	if (__tmpDC_hfont != hFont) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13876
	    prevFont = SelectObject(__tmpDC, hFont);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13877
	    if (__tmpDC_prev_hfont == NULL) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13878
		__tmpDC_prev_hfont = prevFont;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13879
	    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13880
	    __tmpDC_hfont = hFont;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13881
	}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13882
#else
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13883
	prevFont = SelectObject(__tmpDC, hFont);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13884
#endif
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13885
	GetTextMetricsW(__tmpDC, &tmet);
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13886
#if 0
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13887
	{
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13888
	    static char *s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13889
	    static int len;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13890
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13891
	    if (len == 0) {
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13892
		len = strlen(s);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13893
	    }
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13894
	    GetTextExtentPoint32(__tmpDC, s, len, &size);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13895
	    avgWidth = (size.cx / (len / 2) + 1) / 2;
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13896
	}
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13897
#else
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13898
	avgWidth = tmet.tmAveCharWidth;
4087
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13899
#endif
7adf8102c9d9 windows font stuff
ca
parents: 4074
diff changeset
 13900
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 13901
#ifndef CACHE_LAST_TMP_FONT
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13902
	SelectObject(__tmpDC, prevFont);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13903
#endif
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13904
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13905
	__ArrayInstPtr(rawData)->a_element[0] = __MKSMALLINT(tmet.tmAscent);        /* ascent     -> (data at:1) */
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13906
	__ArrayInstPtr(rawData)->a_element[1] = __MKSMALLINT(tmet.tmDescent);       /* descent    -> (data at:2) */
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13907
	__ArrayInstPtr(rawData)->a_element[2] = __MKSMALLINT(tmet.tmAscent);        /* maxAscent  -> (data at:3) */
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13908
	__ArrayInstPtr(rawData)->a_element[3] = __MKSMALLINT(tmet.tmDescent);       /* maxDescent -> (data at:4) */
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13909
	__ArrayInstPtr(rawData)->a_element[4] = __MKSMALLINT(avgWidth);             /* minWidth   -> (data at:5) */
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13910
	__ArrayInstPtr(rawData)->a_element[5] = __MKSMALLINT(tmet.tmMaxCharWidth);  /* maxWidth   -> (data at:6) */
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13911
	__ArrayInstPtr(rawData)->a_element[6] = __MKSMALLINT(avgWidth);             /* avgWidth   -> (data at:7) */
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13912
	__ArrayInstPtr(rawData)->a_element[7] = __MKSMALLINT(tmet.tmFirstChar);     /* min        -> (data at:8) */
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13913
	__ArrayInstPtr(rawData)->a_element[8] = __MKSMALLINT(tmet.tmLastChar);      /* max        -> (data at:9) */
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13914
	__ArrayInstPtr(rawData)->a_element[9] = __MKSMALLINT(tmet.tmDefaultChar);   /* default    -> (data at:10) */
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13915
	t = __charSetSymbolFor(tmet.tmCharSet);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13916
	__ArrayInstPtr(rawData)->a_element[10]= t; __STORE(rawData, t);             /* charSet    -> (data at:11) */
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13917
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13918
	DPRINTF(("textMetrics h=%x  avgAsc=%d avgDesc=%d minW=%d maxW=%d avgW=%d\n",
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13919
		    hFont, tmet.tmAscent, tmet.tmDescent, avgWidth, tmet.tmMaxCharWidth,
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13920
		    tmet.tmAveCharWidth));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 13921
	RETURN (self);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13922
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13923
    RETURN (nil);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13924
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13925
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13926
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13927
releaseFont:aFontId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13928
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 13929
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13930
    if (__isExternalAddress(aFontId)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13931
	HGDIOBJ hFont = _HGDIOBJVal(aFontId);
2619
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 13932
8cd6909a436e cache black & white pens
Claus Gittinger <cg@exept.de>
parents: 2617
diff changeset
 13933
	if (hFont) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13934
#ifdef COUNT_RESOURCES
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13935
	    __cnt_font--;
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13936
	   RES1PRINTF(("DestroyFont %d\n",__cnt_font));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13937
#endif
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 13938
	   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
 13939
	   _DeleteFont(hFont, __LINE__);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13940
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13941
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 13942
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13943
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13944
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13945
sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13946
    "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
 13947
     on this display.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13948
     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
 13949
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13950
    |sizes|
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13951
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13952
    sizes := super sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13953
    (sizes notNil and:[sizes includes:0]) ifTrue:[
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13954
	"special: in X11R5 and above, size 0 means:
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13955
	 there are scaled versions in all sizes available"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13956
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13957
	^ #(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
 13958
    ].
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13959
    ^ sizes
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13960
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13961
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13962
     Display sizesInFamily:'courier' face:'bold' style:'roman'
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13963
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13964
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13965
    "Created: 27.2.1996 / 01:38:15 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13966
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 13967
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13968
widthOf:aString from:index1 to:index2 inFont:aFontId
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13969
    "leftover - bw compatibility"
6040
b6242d3f275d class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6028
diff changeset
 13970
    |w|
b6242d3f275d class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6028
diff changeset
 13971
b6242d3f275d class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6028
diff changeset
 13972
    w := self
6067
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 13973
	widthOf:aString from:index1 to:index2 inFont:aFontId
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 13974
	in:nil with:nil.
6040
b6242d3f275d class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6028
diff changeset
 13975
b6242d3f275d class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6028
diff changeset
 13976
    w isNil ifTrue:[
6067
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 13977
	"/ the primitive returns nil (sigh) for invalid argument
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 13978
	w := self
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 13979
	    widthOf:aString asString asUnicode16String from:index1 to:index2 inFont:aFontId
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 13980
	    in:nil with:nil
6040
b6242d3f275d class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6028
diff changeset
 13981
    ].
b6242d3f275d class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6028
diff changeset
 13982
    ^ w
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13983
!
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13984
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13985
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
 13986
%{  /* NOCONTEXT */
4729
037a913e50db umlaute with TextOutW fixed
Claus Gittinger <cg@exept.de>
parents: 4727
diff changeset
 13987
    unsigned char *cp;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13988
    int len, n, i1, i2, l;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13989
    OBJ cls;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13990
    int nInstBytes;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 13991
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13992
    if (__bothSmallInteger(index1, index2)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13993
     && __isExternalAddress(aFontId)
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13994
     && __isNonNilObject(aString)) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13995
	HGDIOBJ hFont,prevFont;
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 13996
	HDC hDC;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13997
	SIZE tsize;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 13998
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 13999
#define xxPRE_22_FEP_2007
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14000
#ifndef PRE_22_FEP_2007
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14001
#       define N_QUICK_CHARS    1024
4729
037a913e50db umlaute with TextOutW fixed
Claus Gittinger <cg@exept.de>
parents: 4727
diff changeset
 14002
	unsigned short quickWchars[N_QUICK_CHARS];
037a913e50db umlaute with TextOutW fixed
Claus Gittinger <cg@exept.de>
parents: 4727
diff changeset
 14003
	unsigned short *wcharPtr;
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14004
	int mustFree = 0;
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14005
	int i;
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14006
#endif
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14007
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14008
	hFont = _HGDIOBJVal(aFontId);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14009
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14010
	if (__isExternalAddress(aGCId)) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14011
	    struct gcData *gcData = _GCDATA(aGCId);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14012
	    hDC = _getDC(gcData);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14013
	    prevFont = SelectObject(hDC, hFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14014
	} else {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14015
	    hDC = __tmpDC;
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14016
#ifdef CACHE_LAST_TMP_FONT
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14017
	    if (__tmpDC_hfont != hFont) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14018
		prevFont = SelectObject(hDC, hFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14019
		if (__tmpDC_prev_hfont == NULL) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14020
		    __tmpDC_prev_hfont = prevFont;
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14021
		}
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14022
		__tmpDC_hfont = hFont;
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14023
	    }
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14024
#else
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14025
	    prevFont = SelectObject(hDC, hFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14026
#endif
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14027
	}
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14028
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14029
	i1 = __intVal(index1) - 1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14030
	cls = __qClass(aString);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14031
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14032
	if (i1 >= 0) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14033
	    i2 = __intVal(index2) - 1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14034
	    if (i2 < i1) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14035
		RETURN ( __MKSMALLINT( 0 ) );
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14036
	    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14037
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14038
	    cp = (char *) _stringVal(aString);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14039
	    l = i2 - i1 + 1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14040
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 14041
	    if (__isStringLike(aString)) {
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14042
		n = _stringSize(aString);
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14043
    commonWidthChars:
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14044
		if (i2 < n) {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14045
		    cp += i1;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14046
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14047
#ifdef PRE_22_FEP_2007
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14048
		    GetTextExtentPoint32(hDC, cp, l, &tsize);
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14049
#else
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14050
		    if (l <= N_QUICK_CHARS) {
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14051
			wcharPtr = quickWchars;
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14052
			mustFree = 0;
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14053
		    } else {
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14054
			wcharPtr = malloc(sizeof(short)*l);
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14055
			if (! wcharPtr) RETURN (__MKSMALLINT(0));
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14056
			mustFree = 1;
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14057
		    }
4729
037a913e50db umlaute with TextOutW fixed
Claus Gittinger <cg@exept.de>
parents: 4727
diff changeset
 14058
		    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
 14059
		    GetTextExtentPoint32W(hDC, wcharPtr, l, &tsize);
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14060
		    if (mustFree) free(wcharPtr);
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14061
#endif
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14062
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14063
#ifdef SUPERDEBUG
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14064
		    if (__debug__) {
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14065
			char buf[80];
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14066
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14067
			GetTextFace(hDC,80,buf);
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14068
			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
 14069
		    }
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14070
#endif
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14071
		    if (__isExternalAddress(aGCId)) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14072
			SelectObject(hDC, prevFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14073
		    } else {
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14074
#ifndef CACHE_LAST_TMP_FONT
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14075
			SelectObject(hDC, prevFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14076
#endif
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14077
		    }
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14078
		    RETURN ( __MKSMALLINT(tsize.cx) );
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14079
		}
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14080
		RETURN (__MKSMALLINT(0));
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14081
	    }
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14082
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14083
	    nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14084
	    cp += nInstBytes;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14085
	    n = __byteArraySize(aString) - nInstBytes;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14086
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14087
	    if (__isBytes(aString)) {
4727
5a4f88a6e58b always draw 16bit strings
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
 14088
		goto commonWidthChars;
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14089
	    }
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14090
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14091
	    /* Unicode */
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14092
	    if (__isWords(aString)) {
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14093
		n = n / 2;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14094
		if (i2 < n) {
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14095
		    WIDECHAR *w_cp = (WIDECHAR *)cp;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14096
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14097
		    w_cp += i1;
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14098
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14099
		    GetTextExtentPoint32W(hDC, w_cp, l, &tsize);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14100
		    if (__isExternalAddress(aGCId)) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14101
			SelectObject(hDC, prevFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14102
		    } else {
3493
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 14103
#ifndef CACHE_LAST_TMP_FONT
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14104
			SelectObject(hDC, prevFont);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14105
#endif
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 14106
		    }
3493
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 14107
		    RETURN ( __MKSMALLINT(tsize.cx) );
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 14108
		}
3494
ffa880fb2749 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3493
diff changeset
 14109
		RETURN (__MKSMALLINT(0));
3493
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 14110
	    }
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 14111
	}
f074b49b4091 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
 14112
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14113
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14114
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14115
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14116
4511
4430c632995a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4504
diff changeset
 14117
!WinWorkstation methodsFor:'grabbing'!
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14118
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14119
allowEvents:mode
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14120
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14121
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14122
grabKeyboardIn:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14123
    "grab the keyboard"
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14124
%{
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14125
#ifdef NOT_YET_IMPLEMENTED
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14126
    if (__isExternalAddress(aWindowId)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14127
      HWND hWnd = _HWNDVal(aWindowId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14128
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14129
      CPRINTF(("grabKeyboard in %x\n",hWnd));
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14130
    }
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14131
#endif
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14132
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14133
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14134
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14135
grabPointerIn:aWindowId withCursor:aCursorId pointerMode:pMode keyboardMode:kMode confineTo:confineId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14136
    "grap the pointer - return true if ok"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14137
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14138
%{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14139
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14140
	HWND hWnd = _HWNDVal(aWindowId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14141
	HCURSOR hCursor = 0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14142
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 14143
	if (__currentCapture != CAPTURE_NONE) {
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14144
	    PostMessage(__currentPointerView, WM_THREAD_SETCAPTURE, 0, 0);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14145
	    //ReleaseCapture();
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14146
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14147
#if 1
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14148
	/*
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14149
	 * place a special, invisible view above the root
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14150
	 */
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14151
	if (hWnd == __rootWin) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14152
	    hWnd = __rootWinSpezial;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14153
	    ShowWindow(hWnd, SW_SHOWNOACTIVATE);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14154
	    //EnableWindow(hWnd,TRUE);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14155
	    SetWindowPos(hWnd, HWND_TOP,
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14156
			 0, 0, 0, 0,
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 14157
			 SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 14158
			 | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14159
	    CPRINTF(("setRootCapture %x\n",hWnd));
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14160
	}
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14161
#endif
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14162
	if (__isExternalAddress(aCursorId)) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14163
	    hCursor = _HCURSORVal(aCursorId);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14164
	    CPRINTF(("grabPointerIn  SetCapture %x\n",hWnd));
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14165
	}
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14166
	PostMessage(hWnd, WM_THREAD_SETCAPTURE, (INT)hWnd, (INT)hCursor);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14167
	RETURN (true);
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
%}.
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14170
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14171
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14172
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14173
ungrabKeyboard
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14174
    "release the keyboard"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14175
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14176
    activeKeyboardGrab := nil.
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14177
%{
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14178
#ifdef NOT_YET_IMPLEMENTED
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14179
    CPRINTF(("ungrabKeyboard\n"));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14180
#endif
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14181
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14182
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14183
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14184
ungrabPointer
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14185
    "release the pointer"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14186
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14187
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14188
    CPRINTF(("ungrabPointer 1\n"));
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14189
    PostThreadMessage(_dispatchThreadId, WM_THREAD_SETCAPTURE, 0, 0);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14190
%}.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14191
    activePointerGrab := nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14192
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14193
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14194
!WinWorkstation methodsFor:'graphic context stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14195
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 14196
noClipIn:aWindowId gc:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14197
    "disable clipping rectangle"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14198
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14199
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14200
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 14201
    if (__isExternalAddress(aWindowId)
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14202
     && __isExternalAddress(aGCId)) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 14203
	struct gcData *gcData = _GCDATA(aGCId);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14204
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14205
	if (gcData->clipping != FALSE) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14206
#ifdef GDIFLUSH_WHEN_CHANGING_CLIP
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14207
	    GdiFlush();
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14208
#endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14209
	    gcData->clipping = FALSE;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14210
#ifdef CACHE_LAST_DC
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 14211
	    if (lastGcData == gcData) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14212
		SelectClipRgn(gcData->_hDC, NULL);
2661
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 14213
	    }
c68f92ae1cb5 cache the last view-bg-filling DC
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
 14214
#endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14215
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14216
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14217
    }
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
setBackground:bgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14222
    "set background color to be drawn with"
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 */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14225
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14226
    if (__isSmallInteger(bgColorIndex)
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14227
	&& __isExternalAddress(aGCId)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14228
	struct gcData *gcData = _GCDATA(aGCId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14229
	COLORREF bgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14230
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14231
	bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14232
	if (bgColor != gcData->bgColor) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14233
	    gcData->bgColor = bgColor;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14234
#ifdef CACHE_LAST_DC
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14235
	    if (lastGcData == gcData) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14236
		SetBkColor(gcData->_hDC, bgColor);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14237
		/*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14238
		 * no need to flush pen - it does not depend upon
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14239
		 * the bg color
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14240
		 */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14241
	    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14242
#endif
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14243
	}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14244
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14245
	CPRINTF(("setBackground: %x\n", bgColor));
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14246
	RETURN (self);
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14247
    }
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14248
%}.
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14249
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14250
    ^self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14251
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14252
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14253
setBitmapMask:aBitmapId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14254
    "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
 14255
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14256
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14257
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14258
    if (__isExternalAddress(aGCId)) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14259
	struct gcData *gcData = _GCDATA(aGCId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14260
	HBITMAP oldM;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14261
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14262
	oldM = gcData->hMask;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14263
	if (__isExternalAddress(aBitmapId))
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14264
	    gcData->hMask = _HBITMAPVAL(aBitmapId);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14265
	else
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14266
	    gcData->hMask = 0;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14267
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14268
	if (oldM != gcData->hMask) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14269
	    FLUSH_CACHED_DC(gcData);
2643
737ca05060bb handle iconification/deiconification (bad origin)
Claus Gittinger <cg@exept.de>
parents: 2642
diff changeset
 14270
	    CPRINTF(("masks set to %x\n",gcData->hMask));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14271
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14272
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14273
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14274
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14275
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14276
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
 14277
setClipByChildren:aBool in:aWindowId gc:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14278
    "enable/disable drawing into child views"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14279
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14280
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14281
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14282
    if (ISCONNECTED && __isExternalAddress(aGCId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14283
	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
 14284
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14285
	if (gcData && gcData->hWnd) {
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14286
	    int newClip;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14287
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14288
	   newClip = (aBool == true) ? TRUE : FALSE;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14289
	    if (newClip != gcData->clipByChildren) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14290
#ifdef GDIFLUSH_WHEN_CHANGING_CLIP
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14291
		GdiFlush();
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14292
#endif
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14293
		/* set/clear clip by children */
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14294
		gcData->clipByChildren = newClip;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14295
		FLUSH_CACHED_DC(gcData);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14296
	    }
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
 14297
	} else {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14298
	    DPRINTF(("clipping by child failed - invalid window\n" ));
1685
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
 14299
	}
9a37c81aef2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1676
diff changeset
 14300
    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14301
%}.
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 14302
    ^ self
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14303
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14304
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 14305
setClipX:clipXArg y:clipYArg width:clipWidth height:clipHeight in:ignoredDrawableId gc:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14306
    "clip to a rectangle"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14307
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14308
"
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14309
      p--w---
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14310
      |     |
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14311
      h     |  the clipping rectangle
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14312
      |     |
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14313
      -------
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 14314
	  where p = ( clipXArg, clipYArg ), w = clipWidth, h = clipHeight
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14315
"
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14316
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14317
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14318
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14319
    if (  __isExternalAddress(aGCId)
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 14320
       && __bothSmallInteger(clipXArg, clipYArg)
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 14321
       && __bothSmallInteger(clipWidth, clipHeight) ) {
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 14322
	struct gcData *gcData = _GCDATA(aGCId);
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14323
	int cX, cY, cW, cH;
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14324
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 14325
	cX = __intVal(clipXArg);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 14326
	cY = __intVal(clipYArg);
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14327
	cW = __intVal(clipWidth);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14328
	cH = __intVal(clipHeight);
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14329
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14330
	if ((gcData->clipping != TRUE)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14331
	 || (cX != gcData->clipX)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14332
	 || (cY != gcData->clipY)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14333
	 || (cW != gcData->clipW)
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14334
	 || (cH != gcData->clipH)) {
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14335
	    gcData->clipping = TRUE;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14336
	    gcData->clipX = cX;
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14337
	    gcData->clipY = cY;
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14338
	    gcData->clipW = cW;
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14339
	    gcData->clipH = cH;
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14340
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14341
#ifdef GDIFLUSH_WHEN_CHANGING_CLIP
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14342
	    GdiFlush();
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 14343
#endif
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14344
#ifdef CACHE_LAST_DC
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14345
	    /*
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14346
	     * must update current cached DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14347
	     */
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14348
	    if (lastGcData == gcData) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14349
		HRGN region = CreateRectRgn(cX, cY, cX + cW, cY + cH);
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14350
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14351
		if (region == NULL ) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14352
		    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
 14353
		    FLUSH_CACHED_DC(gcData);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14354
		} else {
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14355
		    if (SelectClipRgn(gcData->_hDC, region) == ERROR ) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14356
			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
 14357
			FLUSH_CACHED_DC(gcData);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14358
		    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14359
		    _DeleteObject(region, __LINE__);
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14360
		}
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14361
	    }
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14362
#endif
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14363
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14364
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14365
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14366
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14367
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14368
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14369
setDashes:dashList dashOffset:offset in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14370
    "set line attributes"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14371
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14372
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14373
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14374
    if (__isExternalAddress(aGCId)) {
2677
e2b213c76ec8 preps for WM_MOUSEWHEEL;
Claus Gittinger <cg@exept.de>
parents: 2672
diff changeset
 14375
	PRINTF(("WinWorkstat [warning]: dashes not (yet) implemented\n"));
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14376
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14377
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14378
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14379
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14380
setFont:aFontId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14381
    "set font to be drawn in"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14382
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14383
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14384
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14385
    if (__isExternalAddress(aGCId)
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14386
     && __isExternalAddress(aFontId))
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 14387
    {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14388
	struct gcData *gcData = _GCDATA(aGCId);
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14389
	HGDIOBJ prevFont, hFont;
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14390
	// TEXTMETRIC tmet;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14391
	TEXTMETRICW tmet;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14392
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14393
	hFont = _HGDIOBJVal(aFontId);
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14394
	if (gcData->hFont != hFont) {
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14395
	    gcData->hFont = hFont;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14396
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 14397
#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
 14398
	    if (__tmpDC_hfont != hFont) {
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 14399
		prevFont = SelectObject(__tmpDC, hFont);
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 14400
		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
 14401
		    __tmpDC_prev_hfont = prevFont;
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 14402
		}
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 14403
		__tmpDC_hfont = hFont;
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 14404
	    }
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 14405
#else
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14406
	    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
 14407
#endif
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 14408
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14409
	    GetTextMetricsW(__tmpDC, &tmet);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14410
	    gcData->fontAscent = tmet.tmAscent;
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14411
#ifdef SUPERDEBUG
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14412
	    if (__debug__) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14413
		char buf[80];
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14414
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14415
		GetTextFace(__tmpDC, 80, buf);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14416
		PRINTF(("setFont: %x %s\n", hFont, buf));
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14417
	    }
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14418
#endif
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 14419
#ifndef CACHE_LAST_TMP_FONT
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14420
	    SelectObject(__tmpDC, prevFont);
2696
fca447dc99a8 cache the last tmpDC font (req'd for widthOfString query)
Claus Gittinger <cg@exept.de>
parents: 2695
diff changeset
 14421
#endif
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14422
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14423
#ifdef CACHE_LAST_DC
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14424
	    /*
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14425
	     * must update current cached DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14426
	     */
2623
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14427
	    if (lastGcData == gcData) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14428
		prevFont = SelectObject(gcData->_hDC, hFont);
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14429
		if (! gcData->save_hFont) {
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14430
		    gcData->save_hFont = prevFont;
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14431
		}
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14432
	    }
f35bd0833a59 more tuning (more caching)
Claus Gittinger <cg@exept.de>
parents: 2620
diff changeset
 14433
#endif
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14434
	    RETURN ( self );
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14435
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14436
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14437
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14438
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14439
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14440
setForeground:fgColorIndex background:bgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14441
    "set foreground and background colors to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14442
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14443
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14444
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14445
    if (__bothSmallInteger(fgColorIndex, bgColorIndex)
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14446
	&& __isExternalAddress(aGCId)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14447
	struct gcData *gcData = _GCDATA(aGCId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14448
	COLORREF fg, bg, oldFg, oldBg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14449
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14450
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14451
	bg = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14452
	oldFg = gcData->fgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14453
	oldBg = gcData->bgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14454
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14455
	if ((fg != oldFg) || (bg != oldBg)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14456
	    gcData->fgColor = fg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14457
	    gcData->bgColor = bg;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14458
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14459
#ifdef CACHE_LAST_DC
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14460
	    /*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14461
	     * must update or flush current cached DC
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14462
	     */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14463
	    if (lastGcData == gcData) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14464
		/* Pen only depends upon fg-color */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14465
		if (fg != oldFg) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14466
		    SetTextColor(gcData->_hDC, fg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14467
		    FLUSH_CACHED_PEN(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14468
		}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14469
		if (bg != oldBg) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14470
		    SetBkColor(gcData->_hDC, bg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14471
		}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14472
		FLUSH_CACHED_BRUSH(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14473
	    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14474
#endif
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14475
	    CPRINTF(("setForeground: %x background: %x\n", gcData->fgColor, gcData->bgColor));
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14476
	}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14477
	RETURN (self);
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14478
    }
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14479
%}.
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14480
    ^self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14481
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14482
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14483
setForeground:fgColorIndex background:bgColorIndex mask:aBitmapId in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14484
    "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
 14485
     solid (if aBitmapId is nil)"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14486
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14487
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14488
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14489
    if (__bothSmallInteger(fgColorIndex, bgColorIndex)
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14490
	&& __isExternalAddress(aGCId)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14491
	struct gcData *gcData = _GCDATA(aGCId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14492
	COLORREF fg, bg, oldFg, oldBg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14493
	HBITMAP m, oldM;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14494
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14495
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14496
	bg = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14497
	if (__isExternalAddress(aBitmapId))
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14498
	    m = _HBITMAPVAL(aBitmapId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14499
	else
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14500
	    m = 0;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14501
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14502
	oldFg = gcData->fgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14503
	oldBg = gcData->bgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14504
	oldM = gcData->hMask;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14505
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14506
	if ((oldFg != fg) || (oldBg != bg) || (oldM != m)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14507
	    gcData->fgColor = fg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14508
	    gcData->bgColor = bg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14509
	    gcData->hMask = m;
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14510
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14511
#ifdef CACHE_LAST_DC
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14512
	    /*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14513
	     * must update or flush current cached DC
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14514
	     */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14515
	    if (lastGcData == gcData) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14516
		if (oldM == m) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14517
		    /*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14518
		     * only fg/bg changed
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14519
		     */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14520
		    /* Pen only depends upon fg-color */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14521
		    if (fg != oldFg) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14522
			SetTextColor(gcData->_hDC, fg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14523
			FLUSH_CACHED_PEN(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14524
		    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14525
		    if (bg != oldBg) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14526
			SetBkColor(gcData->_hDC, bg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14527
		    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14528
		    FLUSH_CACHED_BRUSH(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14529
		} else {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14530
		    _releaseDC(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14531
		}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14532
	    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14533
#endif
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14534
	    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
 14535
	}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14536
	RETURN (self);
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14537
    }
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14538
%}.
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14539
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14540
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14541
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14542
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14543
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
 14544
    "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
 14545
     solid (if aBitmapId is nil); also set lineWidth"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14546
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14547
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14548
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14549
    if (__bothSmallInteger(fgColorIndex, bgColorIndex)
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14550
	&& __isSmallInteger(aLineWidth)
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14551
	&& __isExternalAddress(aGCId)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14552
	struct gcData *gcData = _GCDATA(aGCId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14553
	COLORREF fg, bg, oldFg, oldBg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14554
	HBITMAP m, oldM;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14555
	int lw, oldLw;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14556
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14557
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14558
	bg = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14559
	if (__isExternalAddress(aBitmapId))
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14560
	    m = _HBITMAPVAL(aBitmapId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14561
	else
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14562
	    m = 0;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14563
	lw = __intVal(aLineWidth);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14564
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14565
	oldFg = gcData->fgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14566
	oldBg = gcData->bgColor;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14567
	oldLw = gcData->lineWidth;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14568
	oldM = gcData->hMask;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14569
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14570
	if ((oldFg != fg) || (oldBg != bg)
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14571
	 || (oldLw != lw) || (oldM != m)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14572
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14573
	    gcData->fgColor = fg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14574
	    gcData->bgColor = bg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14575
	    gcData->lineWidth = lw;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14576
	    gcData->hMask = m;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14577
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14578
#ifdef CACHE_LAST_DC
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14579
	    /*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14580
	     * must update or flush current cached DC
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14581
	     */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14582
	    if (lastGcData == gcData) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14583
		if ((oldM == m) && (oldLw == lw)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14584
		    /*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14585
		     * only fg/bg changed
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14586
		     */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14587
		    /* Pen only depends upon fg-color */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14588
		    if (fg != oldFg) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14589
			SetTextColor(gcData->_hDC, fg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14590
			FLUSH_CACHED_PEN(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14591
		    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14592
		    if (bg != oldBg) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14593
			SetBkColor(gcData->_hDC, bg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14594
		    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14595
		    FLUSH_CACHED_BRUSH(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14596
		} else {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14597
		    _releaseDC(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14598
		}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14599
	    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14600
#endif
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14601
	    CPRINTF(("setForeground: %x background: %x mask: %x linewidth: %d\n",
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14602
			gcData->fgColor, gcData->bgColor,
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14603
			gcData->hMask, gcData->lineWidth));
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14604
	}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14605
	RETURN (self);
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14606
    }
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14607
%}.
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14608
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14609
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14610
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14611
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14612
setForeground:fgColorIndex in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14613
    "set foreground color to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14614
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14615
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14616
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14617
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14618
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14619
    if (__isSmallInteger(fgColorIndex)
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14620
	&& __isExternalAddress(aGCId)) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14621
	struct gcData *gcData = _GCDATA(aGCId);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14622
	COLORREF fg;
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14623
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14624
	fg = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14625
	if (fg != gcData->fgColor) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14626
	    gcData->fgColor = fg;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14627
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14628
#ifdef CACHE_LAST_DC
5372
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14629
	    /*
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14630
	     * must update or flush current cached DC
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14631
	     */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14632
	    if (lastGcData == gcData) {
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14633
		/* Pen depends upon fg-color */
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14634
		SetTextColor(gcData->_hDC, fg);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14635
		FLUSH_CACHED_PEN(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14636
		FLUSH_CACHED_BRUSH(gcData);
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14637
	    }
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14638
#endif
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14639
	    CPRINTF(("setForeground: %x\n", gcData->fgColor));
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14640
	}
3aae455070f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
 14641
	RETURN (self);
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14642
    }
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14643
%}.
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14644
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 14645
    ^ self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14646
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14647
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14648
setFunction:aFunctionSymbol in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14649
    "set alu function to be drawn with"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14650
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14651
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14652
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14653
    if (__isExternalAddress(aGCId)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14654
	struct gcData *gcData = _GCDATA(aGCId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14655
	int fun = -1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14656
	int bfun = -1;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14657
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14658
	if (aFunctionSymbol == @symbol(copy)) {
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14659
	    fun = R2_COPYPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14660
	    bfun = BITBLT_COPY;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14661
	} else if (aFunctionSymbol == @symbol(copyInverted)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14662
	    fun = R2_NOTCOPYPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14663
	    bfun = BITBLT_COPYINVERTED;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14664
	} else if (aFunctionSymbol == @symbol(xor)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14665
	    fun = R2_XORPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14666
	    bfun = BITBLT_XOR;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14667
	} else if (aFunctionSymbol == @symbol(and)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14668
	    fun = R2_MASKPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14669
	    bfun = BITBLT_AND;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14670
	} else if (aFunctionSymbol == @symbol(or)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14671
	    fun = R2_MERGEPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14672
	    bfun = BITBLT_OR;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14673
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14674
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14675
	if (fun != -1) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14676
#if 0
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14677
	    console_printf("set func to");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14678
	    switch (bfun) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14679
		case BITBLT_COPY:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14680
		    console_printf("BITBLT_COPY\n");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14681
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14682
		case BITBLT_COPYINVERTED:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14683
		    console_printf("BITBLT_COPYINVERTED\n");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14684
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14685
		case BITBLT_XOR:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14686
		    console_printf("BITBLT_XOR\n");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14687
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14688
		case BITBLT_AND:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14689
		    console_printf("BITBLT_AND\n");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14690
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14691
		case BITBLT_OR:
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14692
		    console_printf("BITBLT_OR\n");
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14693
		    break;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14694
	    }
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14695
#endif
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14696
	} else {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14697
	    INFOFPRINTF( (stderr, "WinWorkstat [warning]: unsuported Rasterfunction\n") );
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14698
	    fun = R2_COPYPEN;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14699
	    bfun = BITBLT_COPY;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14700
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14701
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14702
	if ((fun != gcData->rop2)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14703
	 || (bfun != gcData->bitbltrop2)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14704
	    gcData->rop2 = fun;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14705
	    gcData->bitbltrop2 = bfun;
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14706
#ifdef CACHE_LAST_DC
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14707
	    /*
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14708
	     * must update current cached DC
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 14709
	     */
2424
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14710
	    if (gcData == lastGcData) {
03e8723c1bd5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2420
diff changeset
 14711
		SetROP2(gcData->_hDC, fun);
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14712
	    }
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 14713
#endif
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14714
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14715
    } else {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14716
	INFOFPRINTF((stderr, "WinWorkstation [warning]: Rasterfunction no GC\n"));
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14717
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14718
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14719
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14720
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14721
setGraphicsExposures:aBoolean in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14722
    "set or clear the graphics exposures flag"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14723
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14724
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14725
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14726
setLineWidth:aNumber style:lineStyle cap:capStyle join:joinStyle in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14727
    "set line attributes"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14728
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14729
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14730
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14731
    HDC hDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14732
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14733
    if (__isExternalAddress(aGCId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14734
     && __isSmallInteger(aNumber)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14735
	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
 14736
	int style;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14737
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14738
	gcData->lineWidth = __intVal(aNumber);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14739
	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
 14740
	    style = PS_SOLID;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14741
	} 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
 14742
	    style= PS_DASH;
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 14743
	} 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
 14744
	    style= PS_DOT;
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 14745
	} 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
 14746
	    style= PS_DASHDOT;
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 14747
	} 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
 14748
	    style= PS_DASHDOTDOT;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14749
	} else
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14750
	    style= PS_SOLID;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14751
	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
 14752
	gcData->lStyle |= style;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14753
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14754
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14755
	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
 14756
	    style = PS_ENDCAP_ROUND;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14757
	} 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
 14758
	    style = PS_ENDCAP_SQUARE;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14759
	} 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
 14760
	    style = PS_ENDCAP_FLAT;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14761
	} else
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14762
	    style = PS_ENDCAP_FLAT;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14763
	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
 14764
	gcData->lStyle |= style;
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14765
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14766
	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
 14767
	    style = PS_JOIN_BEVEL;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14768
	} 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
 14769
	    style = PS_JOIN_MITER;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14770
	} 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
 14771
	    style = PS_JOIN_ROUND;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14772
	} else
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14773
	    style = PS_JOIN_MITER;
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14774
	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
 14775
	gcData->lStyle |= style;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14776
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14777
	FLUSH_CACHED_DC(gcData);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14778
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14779
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14780
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14781
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14782
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14783
setMaskOriginX:orgX y:orgY in:aGCId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14784
    "set the mask origin"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14785
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14786
%{  /* NOCONTEXT */
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14787
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14788
    if (__isExternalAddress(aGCId)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14789
     && __bothSmallInteger(orgX,orgY)) {
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14790
	struct gcData *gcData = _GCDATA(aGCId);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14791
	int oX, oY;
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14792
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14793
	oX = __intVal(orgX);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14794
	oY = __intVal(orgY);
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14795
	if ((oX != gcData->maskOrgX)
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14796
	 || (oY != gcData->maskOrgY)) {
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14797
	    gcData->maskOrgX = __intVal(orgX);
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14798
	    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
 14799
	    FLUSH_CACHED_DC(gcData);
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14800
	}
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 14801
	RETURN (self);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14802
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14803
%}
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14804
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14805
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14806
setPixmapMask:aPixmapId in:aGCId
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14807
    "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
 14808
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 14809
%{  /* NOCONTEXT */
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14810
    if (__isExternalAddress(aGCId)) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14811
	struct gcData *gcData = _GCDATA(aGCId);
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14812
	HBITMAP oldM;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14813
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14814
	oldM = gcData->hMask;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14815
	if (__isExternalAddress(aPixmapId))
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14816
	    gcData->hMask = _HBITMAPVAL(aPixmapId);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14817
	else
2327
a8ae776721c8 fixed maskOrigin setting
Claus Gittinger <cg@exept.de>
parents: 2325
diff changeset
 14818
	    gcData->hMask = 0;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14819
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14820
	if (oldM != gcData->hMask) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14821
	    FLUSH_CACHED_DC(gcData);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14822
	    DPRINTF(("PixmapMasks set to %x\n",gcData->hMask));
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 14823
	}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14824
	RETURN (self);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14825
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 14826
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14827
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14828
5671
e8f727199c80 category of:12 methods
Claus Gittinger <cg@exept.de>
parents: 5661
diff changeset
 14829
!WinWorkstation methodsFor:'initialization & release'!
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14830
4916
10e7ece60c50 Handle numeric keypad keys with NumLock pressed
Stefan Vogel <sv@exept.de>
parents: 4906
diff changeset
 14831
closeConnection
2369
72986787c2b0 preparations for DC, PEN & BRUSH caching (does not work yet);
Claus Gittinger <cg@exept.de>
parents: 2368
diff changeset
 14832
    "close down the connection to the display"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14833
4916
10e7ece60c50 Handle numeric keypad keys with NumLock pressed
Stefan Vogel <sv@exept.de>
parents: 4906
diff changeset
 14834
"/    Processor disableSemaphore:eventSema
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14835
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14836
3832
85b5220f7ade *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3828
diff changeset
 14837
initializeDefaultKeyboardMappingsIn:aKeyboardMap
4916
10e7ece60c50 Handle numeric keypad keys with NumLock pressed
Stefan Vogel <sv@exept.de>
parents: 4906
diff changeset
 14838
10e7ece60c50 Handle numeric keypad keys with NumLock pressed
Stefan Vogel <sv@exept.de>
parents: 4906
diff changeset
 14839
    #(
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14840
	Copy            Ctrlc           "copy selection to buffer"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14841
	Cut             Ctrlx           "cut selection into buffer"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14842
	Paste           Ctrlv           "paste buffer or external selection"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14843
	UserAbort       CtrlCancel      "Abort window process"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14844
	UserInterrupt   Pause           "interrupt window process"
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14845
	$0              KeyPad0         "NumLocked numeric keypad keys..."
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14846
	$1              KeyPad1
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14847
	$2              KeyPad2
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14848
	$3              KeyPad3
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14849
	$4              KeyPad4
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14850
	$5              KeyPad5
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14851
	$6              KeyPad6
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14852
	$7              KeyPad7
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14853
	$8              KeyPad8
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14854
	$9              KeyPad9
4916
10e7ece60c50 Handle numeric keypad keys with NumLock pressed
Stefan Vogel <sv@exept.de>
parents: 4906
diff changeset
 14855
    ) pairWiseDo:[:eachMapping :eachKey|
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14856
	    aKeyboardMap
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14857
		bindValue:eachMapping to:eachKey.
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 14858
	].
5108
5c92e9b267db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5088
diff changeset
 14859
5c92e9b267db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5088
diff changeset
 14860
    "
5c92e9b267db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5088
diff changeset
 14861
     Screen default initializeDefaultKeyboardMappingsIn:Screen default keyboardMap
4916
10e7ece60c50 Handle numeric keypad keys with NumLock pressed
Stefan Vogel <sv@exept.de>
parents: 4906
diff changeset
 14862
    "
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 14863
!
3832
85b5220f7ade *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3828
diff changeset
 14864
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14865
initializeDefaultValues
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 14866
    focusMode := #activeWindow.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 14867
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 14868
"/    self activateOnClick:true.
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 14869
"/    self ignoreButtonPressOnActivate:false.
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 14870
"/    self rightButtonIsLowerWindow:true.
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 14871
"/    self shiftedLeftButtonIsLowerWindow:true.
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 14872
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14873
    buttonTranslation := ButtonTranslation.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14874
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14875
    self initializeModifierMappings
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14876
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 14877
2695
5d9794d67a5a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2688
diff changeset
 14878
initializeDevice
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 14879
%{
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14880
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14881
    int scr;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14882
    int maxRGBDepth;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14883
    int rgbRedMask, rgbGreenMask, rgbBlueMask;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14884
    int nvi, i;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14885
    char *type, *nm;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14886
    int dummy;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14887
    int mask, shift, nBits;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14888
    HDC _rootDC;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 14889
    OBJ id;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14890
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 14891
    if (firstInstance) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14892
	OSVERSIONINFO osvi;
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14893
	WNDCLASSW wc_stx;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14894
	WNDCLASSW wc_root;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14895
	WNDCLASSW wc_popup;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14896
	WNDCLASSW wc_dialog;
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14897
	firstInstance = 0;
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14898
	DPRINTF(("first create - registerClass\n"));
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14899
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14900
	memset(&osvi, 0, sizeof(OSVERSIONINFO));
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14901
	osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14902
	GetVersionEx (&osvi);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14903
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14904
	switch (osvi.dwMajorVersion) {
6067
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 14905
	    default:
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 14906
		// defaults to the newest version we know about
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 14907
		INFOFPRINTF( (stderr, "WinWorkstat [info]: unknown/new display version %d:%d (assume post vista)\n", osvi.dwMajorVersion, osvi.dwMinorVersion) );
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 14908
		// fall into
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14909
	    case 6:
6067
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 14910
		// vista, win7, win8
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14911
		__isWinXP = 1;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14912
		__isWinVista = 1;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14913
		break;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14914
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14915
	    case 5:
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14916
		// 2k, xp and 2003
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14917
		switch (osvi.dwMinorVersion) {
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14918
		    default:
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14919
		    case 2:         // windows server 2003
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14920
		    case 1:         // windows xp
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14921
			__isWinXP = 1;
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14922
			break;
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14923
		    case 0:
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14924
			__isWin2k = 1;
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14925
		}
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14926
		break;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14927
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14928
	    // no longer supported
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14929
	    case 4:   // nt4.0
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14930
	    case 3:   // nt3.51
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14931
	    case 2:
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14932
	    case 1:
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14933
	    case 0:
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 14934
		INFOFPRINTF( (stderr, "WinWorkstat [error]: no longer supported display version %d:%d\n", osvi.dwMajorVersion, osvi.dwMinorVersion) );
5063
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14935
		break;
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14936
	}
Claus Gittinger <cg@exept.de>
parents: 5062
diff changeset
 14937
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14938
	/*
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14939
	 * register class: ST/X
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14940
	 */
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14941
	wc_stx.style = 0
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14942
		   /* | CS_OWNDC */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14943
		   /* | CS_HREDRAW */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14944
		   /* | CS_VREDRAW */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14945
		  | CS_DBLCLKS;
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14946
	wc_stx.lpfnWndProc = (WNDPROC) MainWndProc;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14947
	wc_stx.cbClsExtra = 0;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14948
	wc_stx.cbWndExtra = N_WINDOW_PRIVATE;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14949
	wc_stx.hInstance = (HANDLE) __getHInstance();
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14950
	wc_stx.hIcon = NULL;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14951
	wc_stx.hCursor = 0;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14952
	wc_stx.hbrBackground = 0;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14953
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14954
	wc_stx.lpszMenuName =  NULL;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14955
	wc_stx.lpszClassName = wapp_name;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14956
	RegisterClassW( (&wc_stx) );
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14957
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14958
	/*
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14959
	 * register class: ST/X:Root
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14960
	 */
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14961
	wc_root.style = 0;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14962
	wc_root.lpfnWndProc = (WNDPROC) MainWndProc;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14963
	wc_root.cbClsExtra = 0;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14964
	wc_root.cbWndExtra = N_WINDOW_PRIVATE;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14965
	wc_root.hInstance = (HANDLE) __getHInstance();
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14966
	wc_root.hIcon = NULL;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14967
	wc_root.hCursor = 0;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14968
	wc_root.hbrBackground = GetStockObject(HOLLOW_BRUSH);
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14969
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14970
	wc_root.lpszMenuName =  NULL;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14971
	wc_root.lpszClassName = wapp_nameRoot;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14972
	RegisterClassW( (CONST WNDCLASSW *)(&wc_root) );
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14973
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14974
	/*
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14975
	 * register class: ST/X:Popup
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14976
	 */
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14977
	wc_popup.style = CS_SAVEBITS;
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14978
	if (__isWinXP) {
3714
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 14979
#ifndef CS_DROPSHADOW
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 14980
# define CS_DROPSHADOW    0x020000
84947d7fb23d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
 14981
#endif
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14982
	    wc_popup.style |= CS_DROPSHADOW;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14983
	}
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14984
	wc_popup.lpfnWndProc = (WNDPROC) MainWndProc;;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14985
	wc_popup.cbClsExtra = 0;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14986
	wc_popup.cbWndExtra = N_WINDOW_PRIVATE;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14987
	wc_popup.hInstance = (HANDLE) __getHInstance();
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14988
	wc_popup.hIcon = NULL;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14989
	wc_popup.hCursor = 0;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14990
	wc_popup.hbrBackground = GetStockObject(HOLLOW_BRUSH);
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14991
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14992
	wc_popup.lpszMenuName =  NULL;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14993
	wc_popup.lpszClassName = wapp_namePopup;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14994
	RegisterClassW( (CONST WNDCLASSW *)(&wc_popup) );
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14995
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14996
	/*
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14997
	 * register class: ST/X:Dialog
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 14998
	 */
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 14999
	wc_dialog.style = CS_SAVEBITS;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 15000
	wc_dialog.lpfnWndProc = (WNDPROC) MainWndProc;;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 15001
	wc_dialog.cbClsExtra = 0;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 15002
	wc_dialog.cbWndExtra = N_WINDOW_PRIVATE;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 15003
	wc_dialog.hInstance = (HANDLE) __getHInstance();
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 15004
	wc_dialog.hIcon = NULL;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 15005
	wc_dialog.hCursor = 0;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 15006
	wc_dialog.hbrBackground = GetStockObject(HOLLOW_BRUSH);
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 15007
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 15008
	wc_dialog.lpszMenuName =  NULL;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 15009
	wc_dialog.lpszClassName = wapp_nameDialog;
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 15010
	RegisterClassW( (CONST WNDCLASSW *)(&wc_dialog) );
5072
fcd3884582e0 unicode stuff
Claus Gittinger <cg@exept.de>
parents: 5067
diff changeset
 15011
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15012
	/*
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15013
	 * generate my events
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15014
	 */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15015
	hDispatchThreadRunningEvent = CreateEvent(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15016
				NULL,            /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15017
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15018
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15019
				"DispatchThreadRunning"); /* name of event */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15020
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15021
	if (hDispatchThreadRunningEvent == NULL) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15022
	    console_fprintf(stderr, "WinWorkstation [fatal]: CreateEvent-0 failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15023
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15024
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15025
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15026
	hNeverTriggered = CreateEvent(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15027
				NULL,            /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15028
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15029
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15030
				"Never");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15031
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15032
	if (hNeverTriggered == NULL) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15033
	    console_fprintf(stderr, "WinWorkstation [fatal]: CreateEvent-1 failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15034
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15035
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15036
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15037
	hCreateEvent = CreateEvent(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15038
				NULL,            /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15039
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15040
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15041
				"CreateEvents"); /* name of event */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15042
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15043
	if (hCreateEvent == NULL) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15044
	    console_fprintf(stderr, "WinWorkstation [fatal]: CreateEvent-2 failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15045
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15046
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15047
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15048
	hInputEvent = CreateEvent(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15049
				NULL,            /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15050
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15051
				FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15052
				"InputEvents");  /* name of event */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15053
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15054
	if (hInputEvent == NULL) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15055
	    console_fprintf(stderr, "WinWorkstation [fatal]: CreateEvent-3 failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15056
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15057
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15058
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15059
	if (hEventsMutex) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15060
	    console_fprintf(stderr, "WinWorkstation [fatal]: hEventsMutex already created\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15061
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15062
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15063
	hEventsMutex = CreateMutex(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15064
				NULL,            /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15065
				FALSE,           /* initially not owned */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15066
				"EventsMutex");  /* name of mutex */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15067
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15068
	if (! hEventsMutex) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15069
	    console_fprintf(stderr, "WinWorkstation [fatal]: hEventsMutex failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15070
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15071
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15072
	DuplicateHandle(GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15073
			hEventsMutex,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15074
			GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15075
			&hEventsMutex,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15076
			DUPLICATE_SAME_ACCESS,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15077
			FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15078
			DUPLICATE_SAME_ACCESS);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15079
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 15080
#ifdef USE_PAINT_MUTEX
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15081
	hPaintMutex = CreateMutex(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15082
				NULL,           /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15083
				FALSE,          /* initially not owned */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15084
				"PaintMutex");  /* name of mutex */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15085
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15086
	if (hPaintMutex == NULL) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15087
	    console_fprintf(stderr, "WinWorkstation [fatal]: CreateMutex(PaintMutex) failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15088
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15089
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15090
	DuplicateHandle(GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15091
			hPaintMutex,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15092
			GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15093
			&hPaintMutex,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15094
			DUPLICATE_SAME_ACCESS,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15095
			FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15096
			DUPLICATE_SAME_ACCESS);
2728
911b6cf212c0 handle 0-return from GetRegionData
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
 15097
#endif
3961
e2f3d8b87361 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3958
diff changeset
 15098
#ifdef USE_DRAW_MUTEX
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15099
	hDrawMutex = CreateMutex(
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15100
				NULL,           /* no security attributes */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15101
				FALSE,          /* initially not owned */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15102
				"DrawMutex");   /* name of mutex */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15103
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15104
	if (hDrawMutex == NULL) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15105
	    console_fprintf(stderr, "WinWorkstation [fatal]: CreateMutex(DrawMutex) failed\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15106
	    exit(1);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15107
	}
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15108
	DuplicateHandle(GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15109
			hDrawMutex,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15110
			GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15111
			&hDrawMutex,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15112
			DUPLICATE_SAME_ACCESS,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15113
			FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15114
			DUPLICATE_SAME_ACCESS);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15115
#endif
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15116
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15117
	_masterThreadId = GetCurrentThreadId();
2336
e7a3b0ec8d52 keypad key-events
Claus Gittinger <cg@exept.de>
parents: 2333
diff changeset
 15118
#ifndef WIN32THREADS
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15119
	DuplicateHandle(GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15120
			GetCurrentThread(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15121
			GetCurrentProcess(),
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15122
			&_masterThread,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15123
			DUPLICATE_SAME_ACCESS,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15124
			FALSE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15125
			DUPLICATE_SAME_ACCESS);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15126
#endif
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15127
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15128
	initEventqueue();
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15129
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15130
	/*
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15131
	 * start the event dispatcher thread and wait for it to
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15132
	 * be ready
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15133
	 */
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15134
	CreateThread((LPSECURITY_ATTRIBUTES)0,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15135
		     EVENT_THREAD_STACKSIZE,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15136
		     (LPTHREAD_START_ROUTINE)dispatchThread,
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15137
		     0, 0, &_dispatchThreadId);
4713
199dbf1a1406 changed #initializeDevice - call CreateThread instead of beginthreadNT
Stefan Vogel <sv@exept.de>
parents: 4712
diff changeset
 15138
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
 15139
#ifdef STARTUP_DISPATCHTHREAD_DEBUG
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15140
	console_fprintf(stderr, "WinWorkstation [info]: dispatchThreadId=%x\n", _dispatchThreadId);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15141
#endif
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15142
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15143
	if (WaitForSingleObject(hDispatchThreadRunningEvent, 5000L) != WAIT_OBJECT_0) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15144
	    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
 15145
	}
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
 15146
#ifdef STARTUP_DISPATCHTHREAD_DEBUG
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15147
	console_fprintf(stderr, "WinWorkstation [info]: got ThreadRunningEvent\n");
4672
a26b308cd0c5 work around strange timing in dispatchEvent thread startup.
ca
parents: 4610
diff changeset
 15148
#endif
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15149
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 15150
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15151
#if 0
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15152
    __rootDesk = OpenDesktop ("Desktop0", 0, FALSE, GENERIC_ALL);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15153
    if (!__rootDesk) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15154
	PRINTF(("OpenDesktop fail\n"));
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15155
	__rootDesk = CreateDesktop ("Desktop0", NULL, NULL, 0, DESKTOP_WRITEOBJECTS, NULL);
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15156
	if (!__rootDesk) {
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15157
	    PRINTF(("CreateDesktop fail\n"));
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15158
	}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15159
    }
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15160
#endif
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 15161
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15162
    __rootWin = GetDesktopWindow();
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15163
    __PROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15164
    id = __MKOBJ(__rootWin);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15165
    __UNPROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15166
    __INST(rootWin) = id; __STORE(self, id);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15167
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15168
    _rootDC = __rootDC = CreateDC("DISPLAY", NULL, NULL, NULL);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15169
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15170
    __tmpDC = CreateCompatibleDC(_rootDC);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15171
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 15172
    __nullPen = GetStockObject(NULL_PEN);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 15173
    __blackPen = GetStockObject(BLACK_PEN);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 15174
    __whitePen = GetStockObject(WHITE_PEN);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 15175
    __blackBrush = GetStockObject(BLACK_BRUSH);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 15176
    __whiteBrush = GetStockObject(WHITE_BRUSH);
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 15177
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15178
    __PROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15179
    id = __MKOBJ(_rootDC);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15180
    __UNPROTECT__(self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15181
    __INST(rootDC) = id; __STORE(self, id);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15182
%}.
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15183
!
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15184
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15185
initializeEventBuffer
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15186
    |sz|
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15187
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15188
%{
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15189
    sz = __MKSMALLINT(sizeof(struct queuedEvent) + 100);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15190
%}.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15191
    eventBuffer isNil ifTrue:[
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15192
	eventBuffer := ByteArray new:sz.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15193
    ].
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15194
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15195
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15196
initializeFor:aDisplayName
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15197
    "initialize the receiver for a connection to the display;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15198
     the argument, aDisplayName is ignored under Win32.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15199
     (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
 15200
      windows displays ...)"
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15201
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15202
    displayId notNil ifTrue:[
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 15203
	"/ already connected - trying to trick me ?
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 15204
	^ self
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15205
    ].
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15206
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15207
    displayId := self primInitializeFor:aDisplayName.
3632
a25578a48a6c Raise signal on device open error.
Stefan Vogel <sv@exept.de>
parents: 3589
diff changeset
 15208
    displayId isNil ifTrue:[
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 15209
	self class deviceOpenErrorSignal raiseWith:aDisplayName
3632
a25578a48a6c Raise signal on device open error.
Stefan Vogel <sv@exept.de>
parents: 3589
diff changeset
 15210
    ].
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15211
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15212
    dispatching := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15213
    isSlow := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15214
    shiftDown := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15215
    ctrlDown := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15216
    metaDown := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15217
    altDown := false.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15218
    motionEventCompression := true.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15219
    buttonsPressed := 0.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15220
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15221
    self initializeScreenProperties.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15222
    self initializeDevice.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15223
    self initializeVariableScreenProperties.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15224
    self initializeVariableSettingsProperties.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15225
    self initializeDeviceResourceTables.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15226
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15227
    self initializeDefaultValues.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15228
    self initializeEventBuffer.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15229
    self initializeSpecialFlags.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15230
    self initializeKeyboardMap.
5708
549499c89f59 delay the stylesheet reading till later
Claus Gittinger <cg@exept.de>
parents: 5672
diff changeset
 15231
    "/ no need to read the stylesheet here - done later...
549499c89f59 delay the stylesheet reading till later
Claus Gittinger <cg@exept.de>
parents: 5672
diff changeset
 15232
    "/ self initializeViewStyle.
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15233
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15234
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15235
initializeModifierMappings
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15236
    shiftModifiers := #(#'Shift_L' #'Shift_R' #'Shift').
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15237
    ctrlModifiers := #(#'Ctrl_L' #'Ctrl_R' #'Ctrl').
4946
d4c1424b0431 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4941
diff changeset
 15238
    metaModifiers := #(#'Alt_L' #'Alt' #'Menu').
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15239
    altModifiers := #(#'Alt_R').
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15240
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15241
2604
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
 15242
initializeSpecialFlags
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
 15243
    "perform additional special server implementation flags"
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
 15244
!
cbac29ab6d78 added #supportsIconMasks
Claus Gittinger <cg@exept.de>
parents: 2602
diff changeset
 15245
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15246
initializeVariableScreenProperties
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 15247
    "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
 15248
     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
 15249
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15250
%{
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15251
    int nvi, i, val, capabilities, planes, numcolors, numpens;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15252
    RECT rect;
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15253
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15254
    GetWindowRect(__rootWin, &rect);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15255
    __INST(width) = __MKSMALLINT(rect.right - rect.left);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15256
    __INST(height) = __MKSMALLINT(rect.bottom - rect.top);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15257
    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
 15258
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15259
    __realDepth = GetDeviceCaps(__rootDC, BITSPIXEL);
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15260
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15261
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15262
    __depth = 24;  /* its a hack */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15263
#else
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15264
    __depth = __realDepth;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15265
    if (__depth == 15)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15266
	__depth = 16;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15267
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15268
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15269
#if 0
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15270
    numcolors = GetDeviceCaps(__rootDC, NUMCOLORS);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15271
    numpens = GetDeviceCaps(__rootDC, NUMPENS);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15272
    planes = GetDeviceCaps(__rootDC, PLANES);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15273
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15274
    DPRINTF(("screen has %d planes\n", planes));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15275
    DPRINTF(("numcolors is %d\n", numcolors));
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15276
    DPRINTF(("numpens is %d\n", numpens));
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15277
#endif
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15278
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15279
    __INST(depth) = __MKSMALLINT(__depth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15280
    __INST(ncells) = __MKSMALLINT(1<<__depth);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15281
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15282
    val = GetDeviceCaps(__rootDC, HORZSIZE);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15283
    DPRINTF(("HORSIZE=%d\n",val));
4386
fb6f4030c861 care to not set widthMM/heightMM to 0
Claus Gittinger <cg@exept.de>
parents: 4374
diff changeset
 15284
    if (val > 0) {
fb6f4030c861 care to not set widthMM/heightMM to 0
Claus Gittinger <cg@exept.de>
parents: 4374
diff changeset
 15285
	__INST(widthMM) = __MKSMALLINT(val);
fb6f4030c861 care to not set widthMM/heightMM to 0
Claus Gittinger <cg@exept.de>
parents: 4374
diff changeset
 15286
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15287
    val = GetDeviceCaps(__rootDC, VERTSIZE);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 15288
    DPRINTF(("VERTSIZE=%d\n",val));
4386
fb6f4030c861 care to not set widthMM/heightMM to 0
Claus Gittinger <cg@exept.de>
parents: 4374
diff changeset
 15289
    if (val > 0) {
fb6f4030c861 care to not set widthMM/heightMM to 0
Claus Gittinger <cg@exept.de>
parents: 4374
diff changeset
 15290
	__INST(heightMM) = __MKSMALLINT(val);
fb6f4030c861 care to not set widthMM/heightMM to 0
Claus Gittinger <cg@exept.de>
parents: 4374
diff changeset
 15291
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15292
    __logPixelSY = GetDeviceCaps(__rootDC, LOGPIXELSY);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15293
    capabilities = GetDeviceCaps(__rootDC, RASTERCAPS);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15294
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15295
#ifdef LATER
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15296
    console_printf("device support:\n");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15297
    if (capabilities & RC_BANDING)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15298
	console_printf(" RC_BANDING");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15299
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15300
    if (capabilities & RC_BITBLT)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15301
	console_printf(" RC_BITBLT");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15302
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15303
    if (capabilities & RC_BITMAP64)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15304
	console_printf(" RC_BITMAP64");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15305
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15306
    if (capabilities & RC_DI_BITMAP)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15307
	console_printf(" RC_DI_BITMAP");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15308
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15309
    if (capabilities & RC_DIBTODEV)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15310
	console_printf(" RC_DIBTODEV");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15311
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15312
    if (capabilities & RC_FLOODFILL)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15313
	console_printf(" RC_FLOODFILL");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15314
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15315
    if (capabilities & RC_PALETTE)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15316
	console_printf(" RC_PALETTE");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15317
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15318
    if (capabilities & RC_SCALING)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15319
	console_printf(" RC_SCALING");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15320
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15321
    if (capabilities & RC_STRETCHBLT)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15322
	console_printf(" RC_STRETCHBLT");
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15323
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15324
    if (capabilities & RC_STRETCHDIB)
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15325
	console_printf(" RC_STRETCHDIB");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15326
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15327
    console_printf("\n");
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15328
    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
 15329
#endif
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15330
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15331
    __INST(whitepixel) = __MKSMALLINT(WhitePixel);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15332
    __INST(blackpixel) = __MKSMALLINT(BlackPixel);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15333
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15334
    __INST(monitorType) = @symbol(unknown);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15335
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15336
#ifdef ALWAYSTRUECOLOR
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15337
    __INST(hasColors) = true;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15338
    __INST(hasGreyscales) = true;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15339
    __INST(visualType) = @symbol(TrueColor);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15340
    __INST(redShift) = __MKSMALLINT(0);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15341
    __INST(greenShift) = __MKSMALLINT(8);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15342
    __INST(blueShift) = __MKSMALLINT(16);
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 15343
    switch (__realDepth) {
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15344
	case 15:
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15345
	case 16:
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15346
	    __INST(bitsPerRGB) = __MKSMALLINT(5);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15347
	    break;
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15348
	default:
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15349
	    __INST(bitsPerRGB) = __MKSMALLINT(8);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15350
    }
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15351
    __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(8);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15352
    __INST(redMask) = __MKSMALLINT(0xFF);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15353
    __INST(greenMask) = __MKSMALLINT(0xFF00);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15354
    __INST(blueMask) = __MKSMALLINT(0xFF0000);
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15355
#else
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15356
    if (! (capabilities & RC_PALETTE)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15357
	DPRINTF(("no palette\n"));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15358
	if (__depth == 1) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15359
	    __INST(hasColors) = false;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15360
	    __INST(hasGreyscales) = false;
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15361
	    __INST(visualType) = @symbol(GrayScale);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15362
	    __INST(monitorType) = @symbol(monochrome);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15363
	} else {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15364
	    __INST(hasColors) = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15365
	    __INST(hasGreyscales) = true;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15366
	    if ((__depth == 16) || (__depth == 15)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15367
	      __INST(visualType) = @symbol(TrueColor);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15368
	      __INST(blueShift) = __MKSMALLINT(0);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15369
	      __INST(greenShift) = __MKSMALLINT(5);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15370
	      __INST(redShift) = __MKSMALLINT(11);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15371
	      __INST(bitsPerRGB) = __MKSMALLINT(5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15372
	      __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(5);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15373
	      __INST(blueMask) = __MKSMALLINT(0x1f);
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15374
	      __INST(greenMask) = __MKSMALLINT(0x7e0);
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15375
	      __INST(redMask) = __MKSMALLINT(0xf800);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15376
	    } else {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15377
	      __INST(visualType) = @symbol(TrueColor);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15378
	      __INST(redShift) = __MKSMALLINT(0);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15379
	      __INST(greenShift) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15380
	      __INST(blueShift) = __MKSMALLINT(16);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15381
	      __INST(bitsPerRGB) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15382
	      __INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(8);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15383
	      __INST(redMask) = __MKSMALLINT(0xFF);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15384
	      __INST(greenMask) = __MKSMALLINT(0xFF00);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15385
	      __INST(blueMask) = __MKSMALLINT(0xFF0000);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15386
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15387
	}
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15388
    } else {
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15389
	val = GetDeviceCaps(__rootDC, SIZEPALETTE); /* First two entries are black and white. */
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 15390
	// console_printf("SizeofPalette %d\n",val);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15391
	__INST(ncells) = __MKSMALLINT(val);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15392
	__INST(blackpixel) = __MKSMALLINT(0);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15393
	__INST(whitepixel) = __MKSMALLINT(1);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15394
	__INST(hasColors) = true;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15395
	__INST(hasGreyscales) = true;
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 15396
	// __INST(usingSystemPalette) = true;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15397
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15398
	__INST(redShift) = __MKSMALLINT(0);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15399
	__INST(greenShift) = __MKSMALLINT(2);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15400
	__INST(blueShift) = __MKSMALLINT(4);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15401
	__INST(bitsPerRGB) = __MKSMALLINT(2);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15402
	__INST(bitsRed) = __INST(bitsGreen) = __INST(bitsBlue) = __MKSMALLINT(2);
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15403
	__INST(redMask) = __MKSMALLINT(0x3);
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15404
	__INST(greenMask) = __MKSMALLINT(0xc);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15405
	__INST(blueMask) = __MKSMALLINT(0x30);
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15406
    }
2601
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15407
#endif /* ! ALWAYSTRUECOLOR */
d97601d0098e getSystemMetrics now an instance method
Claus Gittinger <cg@exept.de>
parents: 2599
diff changeset
 15408
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15409
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15410
2746
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15411
initializeVariableSettingsProperties
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15412
    "fetch properties which can be changed via the user settings.
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15413
     Invoked initially and as a result of the settingsChange event."
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15414
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15415
%{
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15416
    UINT multiClickTime;
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15417
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15418
    multiClickTime = GetDoubleClickTime();
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15419
    DPRINTF(("multiClickTime = %d\n", multiClickTime));
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15420
    __INST(multiClickTimeDelta) = __MKSMALLINT(multiClickTime);
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15421
%}
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15422
!
6aed7520c22f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2743
diff changeset
 15423
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15424
primInitializeFor:aDisplayName
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15425
    "initialize the receiver for a connection to a display;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15426
     the argument, aDisplayName may be nil (for the default display)
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15427
     or the name of the display server as hostname:number
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15428
     (not yet under WIN32)"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15429
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15430
%{  /* NOCONTEXT */
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15431
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15432
    RETURN ( __MKSMALLINT(1) );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15433
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15434
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15435
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15436
reinitialize
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15437
    rootWin := rootDC := nil.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15438
    super reinitialize.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15439
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15440
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15441
!WinWorkstation methodsFor:'keyboard mapping'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15442
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15443
altModifierMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15444
    "return the mask (in motionEvents) for the alt-key modifier.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15445
     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
 15446
     therefore return a variable here, which can be changed during startup."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15447
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15448
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15449
    RETURN (__MKSMALLINT(AltMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15450
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15451
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15452
    "Created: 23.3.1996 / 12:43:22 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15453
    "Modified: 23.3.1996 / 12:44:56 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15454
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15455
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15456
leftAltMask
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15457
    "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
 15458
     See comment in altModifierMask: / metaModifierMask: for what
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15459
     this could be used."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15460
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15461
%{  /* NOCONTEXT */
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15462
    RETURN (__MKSMALLINT(LeftAltMask));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15463
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15464
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15465
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15466
metaModifierMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15467
    "return the mask (in motionEvents) for the meta-key modifier.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15468
     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
 15469
     therefore return a variable here, which can be changed during startup."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15470
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15471
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15472
    RETURN (__MKSMALLINT(MetaMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15473
%}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15474
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15475
    "Created: 23.3.1996 / 12:43:39 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15476
    "Modified: 23.3.1996 / 12:45:09 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15477
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15478
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15479
modifierMapping
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15480
    "Get the Modifier Mapping.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15481
     We return an array of arrays of keycodes"
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15482
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15483
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15484
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15485
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15486
rightAltMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15487
    "return the mask bit for the right Alt modifier key.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15488
     See comment in altModifierMask: / metaModifierMask: for what
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15489
     this could be used."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15490
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15491
%{  /* NOCONTEXT */
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15492
    RETURN (__MKSMALLINT(RightAltMask));
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15493
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15494
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15495
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15496
stringFromKeycode:code
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15497
    "Get a KeySymbol (a smalltalk symbol) from the keycode."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15498
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15499
    ^ ''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15500
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15501
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15502
	Display stringFromKeycode:28
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15503
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15504
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15505
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15506
!WinWorkstation methodsFor:'misc'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15507
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15508
beep
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15509
    "output an audible beep"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15510
5248
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15511
    self beep:#iconExclamation volume:100.
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15512
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15513
    "
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15514
      Display beep
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15515
    "
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15516
!
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15517
5248
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15518
beep:aSymbolOrInteger volume:volumeInPercent
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15519
    "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
 15520
     Volume is ignored here (kept for compatibility with XWorkstation"
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15521
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15522
    UserPreferences current beepEnabled ifFalse:[^ self].
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15523
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15524
%{
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15525
    unsigned int type;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15526
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15527
    if (__isSmallInteger(aSymbolOrInteger)) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15528
	type = __smallIntegerVal(aSymbolOrInteger);
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15529
    } else if (aSymbolOrInteger == @symbol(iconAsterisk)) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15530
	type = MB_ICONASTERISK;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15531
    } else if (aSymbolOrInteger == @symbol(iconExclamation)) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15532
	type = MB_ICONEXCLAMATION;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15533
    } else if (aSymbolOrInteger == @symbol(iconHand)) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15534
	type = MB_ICONHAND;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15535
    } else if (aSymbolOrInteger == @symbol(iconQuestion)) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15536
	type = MB_ICONQUESTION;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15537
    } else if (aSymbolOrInteger == @symbol(ok)) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15538
	type = MB_OK;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15539
    } else {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 15540
	type = 0xffffffff;
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15541
    }
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15542
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 15543
#ifdef BEEP_IN_WINTHREAD
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 15544
    PostThreadMessage(_dispatchThreadId, WM_THREAD_BEEP, 0, 0);
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 15545
#else
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15546
    MessageBeep(type);
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15547
#endif
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15548
%}
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15549
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15550
    "
5248
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15551
      Display beep:#iconExclamation volume:100
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15552
      Display beep:#iconAsterisk volume:100
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15553
      Display beep:#iconQuestion volume:100
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15554
      Display beep:#iconHand volume:100
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15555
      Display beep:#ok volume:100
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15556
      Display beep:nil volume:100
638f38d57e14 Rename beep: to beep:volume: for compatibility with XWorkstation
Stefan Vogel <sv@exept.de>
parents: 5246
diff changeset
 15557
      Display beep:0 volume:100
5246
b9025a68e914 new: #beep:
Stefan Vogel <sv@exept.de>
parents: 5236
diff changeset
 15558
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15559
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15560
4832
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15561
canEndSession:aBoolean
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15562
    "if set to false, Windows is not allowed to finish this session.
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15563
     The default is true."
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15564
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15565
    CanEndSession := aBoolean.
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15566
!
e0db4a6e9cd2 canEndSession
Claus Gittinger <cg@exept.de>
parents: 4831
diff changeset
 15567
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15568
flush
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15569
    "send all buffered drawing to the display.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15570
     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
 15571
     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
 15572
     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
 15573
     (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
 15574
     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
 15575
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15576
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 15577
     GdiFlush();
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15578
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15579
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15580
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15581
monitorHandleForPoint:aPoint
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15582
    "given a point, return a handle to the monitor"
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15583
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15584
    |pX pY|
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15585
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15586
    pX := aPoint x.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15587
    pY := aPoint y.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15588
%{
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15589
    if (__bothSmallInteger(pX, pY)) {
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15590
	POINT p;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15591
	HMONITOR hMonitor;
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15592
	p.x = __intVal(pX);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15593
	p.y = __intVal(pY);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15594
#if 0
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15595
	/* the following is only needed when we want
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15596
	 * to support very old NT/W95/W98 systems; we don't !
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15597
	 */
5570
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15598
	static HMONITOR (__stdcall *P_MonitorFromPoint)(POINT, int);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15599
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15600
	if (P_MonitorFromPoint == 0) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15601
	    HINSTANCE hUser = LoadLibrary("user32.dll");
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15602
	    // console_printf("hUser: %x\n", hUser);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15603
	    if (hUser) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15604
		P_MonitorFromPoint = (HMONITOR (__stdcall *)(POINT, int ))
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15605
				    GetProcAddress(hUser, "MonitorFromPoint");
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15606
	    }
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15607
	}
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15608
	// console_printf("P_MonitorFromPoint: %x\n", P_MonitorFromPoint);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15609
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15610
	hMonitor = (*P_MonitorFromPoint)(p, MONITOR_DEFAULTTONULL);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15611
#else
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15612
	hMonitor = MonitorFromPoint(p, MONITOR_DEFAULTTONULL);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15613
#endif
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15614
	if (hMonitor == 0) {
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15615
	    RETURN(nil);
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15616
	}
33913e2520ac added a PROTECT/UNPROTECT pair (in font handling code)
Claus Gittinger <cg@exept.de>
parents: 5554
diff changeset
 15617
	RETURN ( __MKEXTERNALADDRESS(hMonitor) );
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15618
    }
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15619
%}
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15620
    "
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15621
     Screen current monitorHandleForPoint:(0@0)
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15622
     Screen current monitorHandleForPoint:(1500@0)
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15623
     Screen current monitorHandleForPoint:(3000@0)
5549
fd4fc69df52d fixed: #monitorHandleForPoint:
Claus Gittinger <cg@exept.de>
parents: 5546
diff changeset
 15624
     Screen current monitorHandleForPoint:(Display pointFromUser)
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15625
    "
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15626
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15627
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15628
monitorHandleForView:aWindowId
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15629
    "given a window ID, return a handle to the monitor"
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15630
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15631
%{
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15632
    if (__isExternalAddress(aWindowId)) {
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15633
	HWND hWnd = _HWNDVal(aWindowId);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15634
	HMONITOR hMonitor;
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15635
#if 0
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15636
	/* the following is only needed when we want
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15637
	 * to support very old NT/W95/W98 systems; we don't !
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15638
	 */
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15639
	static HMONITOR (__stdcall *P_MonitorFromWindow)(HWND, int);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15640
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15641
	if (P_MonitorFromWindow == 0) {
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15642
	    HINSTANCE hUser = LoadLibrary("user32.dll");
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15643
	    // console_printf("hUser: %x\n", hUser);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15644
	    if (hUser) {
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15645
		P_MonitorFromWindow = (HMONITOR (__stdcall *)(HWND, int ))
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15646
				    GetProcAddress(hUser, "MonitorFromWindow");
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15647
	    }
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15648
	}
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15649
	// console_printf("P_MonitorFromWindow: %x\n", P_MonitorFromWindow);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15650
	hMonitor = (*P_MonitorFromWindow)(hWnd, MONITOR_DEFAULTTONULL);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15651
#else
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15652
	hMonitor = MonitorFromWindow(hWnd, MONITOR_DEFAULTTONULL);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15653
#endif
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15654
	if (hMonitor == 0) {
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15655
	    RETURN(nil);
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15656
	}
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15657
	RETURN ( __MKEXTERNALADDRESS(hMonitor) );
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15658
    }
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15659
%}
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15660
    "
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15661
     Screen current monitorHandleForView:(Transcript topView id)
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 15662
     Screen current monitorHandleForPoint:(0@0)
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15663
    "
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15664
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 15665
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15666
monitorHandles
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15667
    "retrieve a list of monitor handles"
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15668
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15669
    |handleArray|
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15670
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15671
    handleArray := Array new:(self numberOfMonitors).
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15672
%{
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15673
    struct EnumDisplayMonitorsProcData data;
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15674
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15675
    data.hArray = handleArray;
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15676
    data.index = 0;
7613
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
 15677
    EnumDisplayMonitors(NULL, NULL, EnumDisplayMonitorsProc, (INT)&data);
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15678
%}.
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15679
    ^ handleArray
5842
53c51d88ccac changed: #createWindowFor:type:origin:extent:minExtent:maxExtent:borderWidth:subViewOf:style:inputOnly:label:owner:icon:iconMask:iconView:
Claus Gittinger <cg@exept.de>
parents: 5835
diff changeset
 15680
53c51d88ccac changed: #createWindowFor:type:origin:extent:minExtent:maxExtent:borderWidth:subViewOf:style:inputOnly:label:owner:icon:iconMask:iconView:
Claus Gittinger <cg@exept.de>
parents: 5835
diff changeset
 15681
    "
53c51d88ccac changed: #createWindowFor:type:origin:extent:minExtent:maxExtent:borderWidth:subViewOf:style:inputOnly:label:owner:icon:iconMask:iconView:
Claus Gittinger <cg@exept.de>
parents: 5835
diff changeset
 15682
     Screen default monitorHandles
53c51d88ccac changed: #createWindowFor:type:origin:extent:minExtent:maxExtent:borderWidth:subViewOf:style:inputOnly:label:owner:icon:iconMask:iconView:
Claus Gittinger <cg@exept.de>
parents: 5835
diff changeset
 15683
    "
53c51d88ccac changed: #createWindowFor:type:origin:extent:minExtent:maxExtent:borderWidth:subViewOf:style:inputOnly:label:owner:icon:iconMask:iconView:
Claus Gittinger <cg@exept.de>
parents: 5835
diff changeset
 15684
53c51d88ccac changed: #createWindowFor:type:origin:extent:minExtent:maxExtent:borderWidth:subViewOf:style:inputOnly:label:owner:icon:iconMask:iconView:
Claus Gittinger <cg@exept.de>
parents: 5835
diff changeset
 15685
    "Modified (comment): / 28-01-2012 / 10:26:55 / cg"
5835
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15686
!
c0a484cb40bf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5726
diff changeset
 15687
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15688
setInputFocusTo:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15689
    self setInputFocusTo:aWindowId revertTo:nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15690
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15691
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15692
setInputFocusTo:aWindowId revertTo:revertSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15693
    "set the focus to the view as defined by aWindowId.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15694
     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
 15695
     input until a new focus is set.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15696
     RevertSymbol specifies what should happen if the view becomes invisible;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15697
     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
 15698
     given to the parent view, the root view or no view."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15699
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 15700
%{
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15701
    if (__isExternalAddress(aWindowId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15702
	HWND hWnd = _HWNDVal(aWindowId);
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 15703
	int r = 0;
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15704
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15705
	if (revertSymbol == @symbol(parent)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15706
	    r = 1;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15707
	} else if (revertSymbol == @symbol(root)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15708
	    r = 2;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15709
	}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15710
	if (hWnd) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15711
	    if (GetFocus() != hWnd) {
6003
2a2de0c8e157 debugging
Claus Gittinger <cg@exept.de>
parents: 5997
diff changeset
 15712
		DPRINTFIF(__debug_WM_FOCUS__ , ("setInputFocusTo %x revertTo %d\n",hWnd,r));
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15713
#ifdef SET_FOCUS_IN_WINTHREAD
2668
5d124ccee006 NT fixes
Claus Gittinger <cg@exept.de>
parents: 2667
diff changeset
 15714
		PostMessage(hWnd, WM_THREAD_SETFOCUS, (INT)hWnd, GetCurrentThreadId());
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15715
#else
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15716
		if (SetFocus(hWnd) == 0) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15717
		    PRINTF(("SetFocus to %x failed.\n",hWnd));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15718
		}
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15719
#endif
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15720
	    } else {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 15721
		CPRINTF(("setInputFocusTo %x revertTo %d\n",hWnd,r));
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 15722
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15723
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15724
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15725
    }
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 15726
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15727
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 15728
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15729
!WinWorkstation methodsFor:'native dialogs'!
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15730
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15731
nativeConfirm:aString title:titleString flags:flags initialAnswer:trueOrFalse
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15732
     ^ self
5600
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15733
	    nativeMessageBoxFor:nil
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15734
	    text:aString asString string
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15735
	    title:titleString
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15736
	    flags:flags
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15737
	    blocking:false
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15738
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15739
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15740
      Screen current
5600
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15741
	nativeConfirm:'please confirm'
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15742
	title:'Confirm'
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15743
	flags:#( APPLMODAL ICONQUESTION OKCANCEL)
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15744
	initialAnswer:true
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15745
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15746
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15747
      Screen current
5600
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15748
	nativeConfirm:'Yes or No'
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15749
	title:'Confirm'
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15750
	flags:#( APPLMODAL ICONQUESTION YESNO)
6d3669a3094e fixed bug introduced with double-click capture/releaseCapture
az
parents: 5598
diff changeset
 15751
	initialAnswer:true
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15752
     "
4732
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15753
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15754
    "Modified: / 02-03-2007 / 15:37:57 / cg"
5598
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 15755
    "Modified: / 24-08-2010 / 16:17:29 / sr"
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15756
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15757
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15758
nativeConfirmOKCancel:aString title:titleString initialAnswer:trueOrFalse
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15759
     ^ (self
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15760
	    nativeConfirm:aString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15761
	    title:titleString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15762
	    flags:#( APPLMODAL ICONQUESTION OKCANCEL)
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15763
	    initialAnswer:trueOrFalse) == #IDOK
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15764
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15765
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15766
      Screen current
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15767
	nativeConfirmOKCancel:'please confirm' title:'Confirm' initialAnswer:true
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15768
     "
4732
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15769
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15770
    "Modified: / 02-03-2007 / 15:37:32 / cg"
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15771
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15772
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15773
nativeConfirmYesNo:aString title:titleString initialAnswer:trueOrFalse
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15774
     ^ (self
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15775
	    nativeConfirm:aString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15776
	    title:titleString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15777
	    flags:#( APPLMODAL ICONQUESTION YESNO)
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15778
	    initialAnswer:trueOrFalse) == #IDYES
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15779
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15780
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15781
      Screen current
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 15782
	nativeConfirmYesNo:'please confirm' title:'Confirm' initialAnswer:true
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15783
     "
4732
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15784
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 15785
    "Modified: / 02-03-2007 / 15:12:49 / cg"
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15786
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 15787
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15788
nativeFileDialogFor:ownerId save:isSaveDialog title:titleOrNil inDirectory:dirPathOrNil
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15789
	     initialAnswer:initialOrNil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15790
	     filter:filterArrayOrNil extension:extensionOrNil
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15791
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15792
    "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
 15793
     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
 15794
     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
 15795
     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
 15796
     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
 15797
     filterArrayOrNil: if non nil, must be an array of 2-element arrays,
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15798
		       each element specifying filter commnet and filter
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15799
		       i.e. #( 'bitmap files (*.bmp)' '*.bmp' )
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15800
		       i.e. #( 'smalltalk files' '*.st' )
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15801
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15802
     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
 15803
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15804
    |flags|
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15805
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15806
    isSaveDialog ifTrue:[
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15807
	flags := #(
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15808
			#ENABLESIZING
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15809
			#HIDEREADONLY
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15810
			#EXPLORER
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15811
			#ENABLESIZING
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15812
			#OVERWRITEPROMPT
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15813
			#NOCHANGEDIR
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15814
		  )
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15815
    ] ifFalse:[
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15816
	flags := #(
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15817
			#ENABLESIZING
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15818
			#HIDEREADONLY
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15819
			#EXPLORER
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15820
			#ENABLESIZING
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15821
			#NOCHANGEDIR
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15822
		  )
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15823
    ].
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15824
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15825
    ^ self
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15826
	nativeFileDialogFor:ownerId
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15827
	save:isSaveDialog
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15828
	title:titleOrNil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15829
	inDirectory:dirPathOrNil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15830
	initialAnswer:initialOrNil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15831
	flags:flags
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15832
	filter:filterArrayOrNil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15833
	extension:extensionOrNil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15834
	blocking:false
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15835
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15836
    "
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15837
     Display
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15838
	nativeFileDialogFor:nil save:false
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15839
	title:'Test OpenFile Dialog'
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15840
	inDirectory:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15841
	initialAnswer:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15842
	filter:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15843
	extension:nil
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15844
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15845
     Display
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15846
	nativeFileDialogFor:nil save:true
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15847
	title:'Test SaveFile Dialog'
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15848
	inDirectory:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15849
	initialAnswer:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15850
	filter:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15851
	extension:nil
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15852
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15853
     Display
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15854
	nativeFileDialogFor:nil save:true
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15855
	title:'Test SaveFile Dialog'
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15856
	inDirectory:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15857
	initialAnswer:'newFile.bmp'
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15858
	filter:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15859
	extension:'bmp'
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15860
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15861
     Display
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15862
	nativeFileDialogFor:nil save:false
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15863
	title:'Test OpenFile Dialog'
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15864
	inDirectory:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15865
	initialAnswer:nil
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15866
	filter:#(
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15867
		    #( 'all files'       '*.*' )
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15868
		    #( 'smalltalk files' '*.st' )
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15869
		    #( 'change files'    '*.chg' )
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15870
		    #( 'image files'     '*.img' )
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15871
		)
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 15872
	extension:nil
5641
b03c7d938fca changed: #nativeFileDialogFor:save:title:inDirectory:initialAnswer:filter:extension:
Claus Gittinger <cg@exept.de>
parents: 5640
diff changeset
 15873
    "
b03c7d938fca changed: #nativeFileDialogFor:save:title:inDirectory:initialAnswer:filter:extension:
Claus Gittinger <cg@exept.de>
parents: 5640
diff changeset
 15874
b03c7d938fca changed: #nativeFileDialogFor:save:title:inDirectory:initialAnswer:filter:extension:
Claus Gittinger <cg@exept.de>
parents: 5640
diff changeset
 15875
    "Modified: / 26-10-2010 / 17:08:04 / cg"
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15876
!
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 15877
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15878
nativeFileDialogFor:ownerId save:isSaveDialog title:titleOrNil inDirectory:dirPathOrNil
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15879
	     initialAnswer:initialOrNil flags:flagArray
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15880
	     filter:filterArrayOrNil extension:extensionOrNil
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15881
	     blocking:blocking
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15882
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15883
    "start a native open-file dialog.
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15884
     If not cancelled, the selected fileName is returned; nil otherwise.
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15885
     Of course, this one looks like the
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15886
     Windows file dialog - no matter which viewStyle settings are active.
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15887
     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
 15888
     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
 15889
		       each element specifying filter commnet and filter
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15890
		       i.e. #( 'bitmap files (*.bmp)' '*.bmp' )
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15891
		       i.e. #( 'smalltalk files' '*.st' )
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15892
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15893
     EXPERIMENTAL & non-portable: use with caution"
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15894
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15895
    |rslt errorCode fileName|
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15896
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15897
%{  /* STACK: 32000*/
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15898
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15899
#ifndef NO_NATIVE_DIALOGS
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15900
    OPENFILENAME ofn;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15901
    HWND hWndOwner = NULL;
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15902
    char fileNameBuffer[256] = "\0";
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15903
    char filterBuffer[1024*4] = "\0";
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15904
    BOOL __rslt;
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 15905
    jmp_buf exitJmpBuf;
7303
67a76c07b757 some changes to make compiler happier (function protos to avoid warnings)
Claus Gittinger <cg@exept.de>
parents: 7300
diff changeset
 15906
    extern void __setAtExitLongJmp(jmp_buf);
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15907
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15908
    if (__isExternalAddress(ownerId)) {
3521
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 15909
	hWndOwner = _HWNDVal(ownerId);
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 15910
    }
951a266969d1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3509
diff changeset
 15911
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15912
# ifdef OPENFILENAME_SIZE_VERSION_400
3526
e9c3f08c2305 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3525
diff changeset
 15913
    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
 15914
# else
3544
6c59714157cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3526
diff changeset
 15915
    ofn.lStructSize = sizeof(ofn);
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 15916
# endif
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15917
    ofn.hwndOwner = hWndOwner;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15918
    ofn.hInstance = NULL;
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15919
4405
f4c62bb63035 isArrayLike to support immutable arrays
Claus Gittinger <cg@exept.de>
parents: 4388
diff changeset
 15920
    if ((filterArrayOrNil != nil) && __isArrayLike(filterArrayOrNil)) {
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15921
	char *dst = filterBuffer;
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 15922
	unsigned int idx;
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15923
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15924
	for (idx=0; idx<__arraySize(filterArrayOrNil); idx++) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15925
	    OBJ el = __ArrayInstPtr(filterArrayOrNil)->a_element[idx];
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 15926
	    // console_printf("idx = %d\n", idx);
4405
f4c62bb63035 isArrayLike to support immutable arrays
Claus Gittinger <cg@exept.de>
parents: 4388
diff changeset
 15927
	    if (__isArrayLike(el) && (__arraySize(el) == 2)) {
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15928
		OBJ descr, filter;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15929
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15930
		descr = __ArrayInstPtr(el)->a_element[0];
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15931
		filter = __ArrayInstPtr(el)->a_element[1];
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 15932
		if (__isStringLike(descr) && __isStringLike(filter)) {
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15933
		    char *src = __stringVal(descr);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15934
8144
abf53adf9239 comments
Claus Gittinger <cg@exept.de>
parents: 8055
diff changeset
 15935
		    // 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
 15936
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15937
		    // append (incl 0-byte)
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15938
		    while (*src) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15939
			*dst++ = *src++;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15940
		    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15941
		    *dst++ = '\0';
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15942
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15943
		    src = __stringVal(filter);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15944
		    // append (incl 0-byte)
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15945
		    while (*src) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15946
			*dst++ = *src++;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15947
		    }
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 15948
		    *dst++ = '\0';
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15949
		}
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15950
	    }
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15951
	}
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15952
	*dst++ = '\0';
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15953
	*dst = '\0';
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15954
	ofn.lpstrFilter = filterBuffer;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15955
	ofn.nFilterIndex = 1;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15956
    } else {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15957
	ofn.lpstrFilter = NULL;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15958
	ofn.nFilterIndex = 0;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15959
    }
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15960
    ofn.lpstrCustomFilter = NULL;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15961
    ofn.nMaxCustFilter = 0;
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15962
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 15963
    if (__isStringLike(initialOrNil)) {
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15964
	strcpy(fileNameBuffer, __stringVal(initialOrNil));
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15965
    }
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15966
    ofn.lpstrFile = fileNameBuffer;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15967
    ofn.nMaxFile = sizeof(fileNameBuffer);
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15968
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15969
    ofn.lpstrFileTitle = NULL;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15970
    ofn.nMaxFileTitle = 0;
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 15971
    if (__isStringLike(dirPathOrNil)) {
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15972
	ofn.lpstrInitialDir = __stringVal(dirPathOrNil);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15973
    } else {
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 15974
	ofn.lpstrInitialDir = NULL;
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15975
    }
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15976
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 15977
    if (__isStringLike(titleOrNil)) {
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15978
	ofn.lpstrTitle = __stringVal(titleOrNil);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15979
    } else {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15980
	ofn.lpstrTitle = "";
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15981
    }
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15982
    ofn.nFileOffset = 0;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15983
    ofn.nFileExtension = 0;
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 15984
    if (__isStringLike(extensionOrNil)) {
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15985
	ofn.lpstrDefExt = __stringVal(extensionOrNil);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15986
    } else {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15987
	ofn.lpstrDefExt = NULL;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15988
    }
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15989
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 15990
    ofn.lCustData = (INT)NULL;
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15991
    ofn.lpfnHook = NULL;
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 15992
    ofn.lpTemplateName = NULL;
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 15993
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15994
    ofn.Flags = 0;
4405
f4c62bb63035 isArrayLike to support immutable arrays
Claus Gittinger <cg@exept.de>
parents: 4388
diff changeset
 15995
    if (__isNonNilObject(flagArray) && __isArrayLike(flagArray)) {
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 15996
	unsigned int i;
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15997
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15998
	for (i=0; i<__arraySize(flagArray); i++) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 15999
	    OBJ flag = __ArrayInstPtr(flagArray)->a_element[i];
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16000
	    int flagVal = 0;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16001
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16002
	    if (__isSmallInteger(flag)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16003
		flagVal = __intVal(flag);
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16004
	    } else if (flag == @symbol(READONLY)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16005
		flagVal = OFN_READONLY;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16006
	    } else if (flag == @symbol(OVERWRITEPROMPT)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16007
		flagVal = OFN_OVERWRITEPROMPT;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16008
	    } else if (flag == @symbol(HIDEREADONLY)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16009
		flagVal = OFN_HIDEREADONLY;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16010
	    } else if (flag == @symbol(NOCHANGEDIR)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16011
		flagVal = OFN_NOCHANGEDIR;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16012
	    } else if (flag == @symbol(SHOWHELP)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16013
		flagVal = OFN_SHOWHELP;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16014
	    } else if (flag == @symbol(ENABLEHOOK)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16015
		flagVal = OFN_ENABLEHOOK;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16016
	    } else if (flag == @symbol(ENABLETEMPLATE)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16017
		flagVal = OFN_ENABLETEMPLATE;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16018
	    } else if (flag == @symbol(ENABLETEMPLATEHANDLE)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16019
		flagVal = OFN_ENABLETEMPLATEHANDLE;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16020
	    } else if (flag == @symbol(NOVALIDATE)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16021
		flagVal = OFN_NOVALIDATE;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16022
	    } else if (flag == @symbol(ALLOWMULTISELECT)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16023
		flagVal = OFN_ALLOWMULTISELECT;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16024
	    } else if (flag == @symbol(EXTENSIONDIFFERENT)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16025
		flagVal = OFN_EXTENSIONDIFFERENT;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16026
	    } else if (flag == @symbol(PATHMUSTEXIST)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16027
		flagVal = OFN_PATHMUSTEXIST;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16028
	    } else if (flag == @symbol(FILEMUSTEXIST)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16029
		flagVal = OFN_FILEMUSTEXIST;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16030
	    } else if (flag == @symbol(CREATEPROMPT)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16031
		flagVal = OFN_CREATEPROMPT;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16032
	    } else if (flag == @symbol(SHAREAWARE)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16033
		flagVal = OFN_SHAREAWARE;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16034
	    } else if (flag == @symbol(NOREADONLYRETURN)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16035
		flagVal = OFN_NOREADONLYRETURN;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16036
	    } else if (flag == @symbol(NOTESTFILECREATE)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16037
		flagVal = OFN_NOTESTFILECREATE;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16038
	    } else if (flag == @symbol(NONETWORKBUTTON)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16039
		flagVal = OFN_NONETWORKBUTTON;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16040
	    } else if (flag == @symbol(NOLONGNAMES)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16041
		flagVal = OFN_NOLONGNAMES;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16042
# ifdef OFN_EXPLORER
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16043
	    } else if (flag == @symbol(EXPLORER)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16044
		flagVal = OFN_EXPLORER;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16045
# endif
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16046
# ifdef OFN_NODEREFERENCELINKS
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16047
	    } else if (flag == @symbol(NODEREFERENCELINKS)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16048
		flagVal = OFN_NODEREFERENCELINKS;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16049
# endif
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16050
# ifdef OFN_LONGNAMES
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16051
	    } else if (flag == @symbol(LONGNAMES)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16052
		flagVal = OFN_LONGNAMES;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16053
# endif
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16054
# ifdef OFN_ENABLEINCLUDENOTIFY
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16055
	    } else if (flag == @symbol(ENABLEINCLUDENOTIFY)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16056
		flagVal = OFN_ENABLEINCLUDENOTIFY;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16057
# endif
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16058
# ifdef OFN_ENABLESIZING
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16059
	    } else if (flag == @symbol(ENABLESIZING)) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16060
		flagVal = OFN_ENABLESIZING;
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16061
# endif
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16062
	    }
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16063
	    ofn.Flags |= flagVal;
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16064
	}
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16065
    }
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 16066
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16067
    if (isSaveDialog == true) {
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16068
	if (blocking == true) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16069
	    __rslt = GetSaveFileName(&ofn);
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16070
	} else {
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 16071
	    do {
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 16072
		__threadErrno = 0;
7509
d18f375ac80d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7472
diff changeset
 16073
		__rslt = (BOOL)((INT) __STX_API_CALL1( "GetSaveFileName", (voidFUNC)GetSaveFileName, (void *)(&ofn)));
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 16074
	    } while ((__rslt < 0) && (__threadErrno == EINTR));
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16075
	}
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16076
    } else {
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16077
	if (blocking == true) {
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16078
	    __rslt = GetOpenFileName(&ofn);
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16079
	} else {
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 16080
	    do {
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 16081
		__threadErrno = 0;
7509
d18f375ac80d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7472
diff changeset
 16082
		__rslt = (BOOL)((INT) __STX_API_CALL1( "GetOpenFileName", (voidFUNC)GetOpenFileName, (void *)(&ofn)));
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 16083
	    } while ((__rslt < 0) && (__threadErrno == EINTR));
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16084
	}
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16085
    }
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16086
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16087
    if ( @global(WinWorkstation:VerboseNativeDialogs) == true) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16088
	console_fprintf(stderr, "WinWorkstation [info]: after GetOpenFileName\n");
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16089
    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16090
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16091
    if (setjmp(exitJmpBuf)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16092
	__setAtExitLongJmp(0);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16093
	if ( @global(WinWorkstation:VerboseNativeDialogs) == true) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16094
	    console_fprintf(stderr, "WinWorkstation [warning]: exit longjmp\n");
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16095
	}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16096
	rslt = false;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16097
	errorCode = __MKSMALLINT(0);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16098
	goto getOutOfHere;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16099
    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16100
    __setAtExitLongJmp(exitJmpBuf);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16101
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16102
    if (__rslt == TRUE) {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16103
	rslt = true;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16104
	fileName = __MKSTRING(fileNameBuffer);
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16105
    } else {
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16106
	rslt = false;
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16107
	errorCode = __MKSMALLINT(CommDlgExtendedError());
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16108
    }
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16109
    __setAtExitLongJmp(0);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16110
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16111
#else
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16112
    errorCode = __MKSMALLINT(-1);
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16113
#endif /* NO_NATIVE_DIALOGS */
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 16114
getOutOfHere: ;
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 16115
%}.
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16116
    (errorCode notNil) ifTrue:[
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 16117
	errorCode ~~ 0 ifTrue:[
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 16118
	    self primitiveFailed.
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 16119
	].
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 16120
	^ nil
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 16121
    ].
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 16122
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16123
    ^ fileName
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16124
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16125
    "
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16126
     Display
3523
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16127
	nativeFileDialogFor:nil save:false
4c9da20060cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3521
diff changeset
 16128
	title:'Test OpenFile Dialog'
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16129
	inDirectory:nil
3524
acda6406358d native fileDialog
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
 16130
	initialAnswer:nil
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16131
	flags:#( ENABLESIZING HIDEREADONLY EXPLORER ENABLESIZING )
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16132
	filter:#(
3525
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16133
		    #( 'all files'       '*.*' )
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16134
		    #( 'smalltalk files' '*.st' )
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16135
		    #( 'change files'    '*.chg' )
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16136
		    #( 'image files'     '*.img' )
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16137
		)
0afbeec72edb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3524
diff changeset
 16138
	extension:nil
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16139
	blocking:false
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16140
    "
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16141
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16142
    "
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16143
     Display
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16144
	nativeFileDialogFor:nil save:false
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16145
	title:'Test OpenFile Dialog'
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16146
	inDirectory:nil
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16147
	initialAnswer:nil
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16148
	flags:#( ENABLESIZING HIDEREADONLY EXPLORER ENABLESIZING )
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16149
	filter:#(
3548
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16150
		    #( 'all files'       '*.*' )
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16151
		    #( 'smalltalk files' '*.st' )
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16152
		    #( 'change files'    '*.chg' )
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16153
		    #( 'image files'     '*.img' )
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16154
		)
5c33ea9fc4f3 conditional compilation for native dialog support
Claus Gittinger <cg@exept.de>
parents: 3544
diff changeset
 16155
	extension:nil
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16156
	blocking:true
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16157
    "
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16158
!
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16159
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16160
nativeGetDefaultPrinterDialog
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16161
    "start a native printer dialog.
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16162
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16163
     EXPERIMENTAL & non-portable: use with caution"
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16164
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16165
    |errorCode newDCHandle|
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16166
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16167
%{  /* STACK: 32000*/
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16168
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16169
#ifdef NO_NATIVE_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16170
# define NO_NATIVE_PRINT_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16171
#endif
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16172
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16173
#define NO_NATIVE_PRINT_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16174
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16175
#ifndef NO_NATIVE_PRINT_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16176
    PRINTDLG pdsetup;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16177
    OBJ newGCHandle;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16178
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16179
    memset(&pdsetup, 0, sizeof(pdsetup));
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16180
    pdsetup.lStructSize = sizeof(pdsetup);
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16181
    pdsetup.Flags = PD_RETURNDEFAULT | PD_RETURNDC;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16182
    if (! PrintDlg(&pdsetup)) {
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 16183
	RETURN (nil);
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16184
    }
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16185
    if ( pdsetup.hDC ) {
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 16186
	newDCHandle = __MKOBJ( pdsetup.hDC );
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16187
    }
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16188
#else
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16189
    errorCode = __MKSMALLINT(-1);
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16190
#endif /* NO_NATIVE_PRINT_DIALOGS */
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16191
%}.
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16192
    (errorCode notNil) ifTrue:[
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 16193
	self primitiveFailed.
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 16194
	^ nil
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16195
    ].
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16196
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16197
    ^ newDCHandle
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16198
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16199
    "
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16200
     Display nativeGetDefaultPrinterDialog
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16201
    "
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16202
!
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16203
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16204
nativeGetPrinterDialogDefault:defaultBoolean
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16205
    "start a native printer dialog.
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16206
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16207
     EXPERIMENTAL & non-portable: use with caution"
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16208
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16209
    |errorCode newDCHandle|
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16210
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16211
%{  /* STACK: 32000*/
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16212
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16213
#ifdef NO_NATIVE_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16214
# define NO_NATIVE_PRINT_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16215
#endif
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16216
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16217
#define xxNO_NATIVE_PRINT_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16218
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16219
#ifndef NO_NATIVE_PRINT_DIALOGS
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16220
    PRINTDLG pdsetup;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16221
    OBJ newGCHandle;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16222
    int answer;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16223
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16224
    memset(&pdsetup, 0, sizeof(pdsetup));
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16225
    pdsetup.lStructSize = sizeof(pdsetup);
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16226
    pdsetup.Flags = PD_RETURNDC;
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16227
    if (defaultBoolean == true) {
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 16228
	pdsetup.Flags |= PD_RETURNDEFAULT;
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16229
    }
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16230
# ifdef BLOCKING
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16231
    answer = PrintDlg(&pdsetup);
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16232
# else
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16233
    answer = __STX_API_CALL1( "PrintDlg",
7509
d18f375ac80d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7472
diff changeset
 16234
					(voidFUNC)PrintDlg,
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 16235
					(void *)&pdsetup );
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16236
# endif
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16237
    if (! answer) {
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 16238
	RETURN (nil);
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16239
    }
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16240
    if ( pdsetup.hDC ) {
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 16241
	newDCHandle = __MKOBJ( pdsetup.hDC );
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16242
    }
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16243
#else
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16244
    errorCode = __MKSMALLINT(-1);
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16245
#endif /* NO_NATIVE_PRINT_DIALOGS */
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16246
%}.
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16247
    (errorCode notNil) ifTrue:[
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 16248
	self primitiveFailed.
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 16249
	^ nil
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16250
    ].
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16251
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16252
    ^ newDCHandle
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16253
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16254
    "
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16255
     Display nativeGetPrinterDialogDefault:true
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16256
     Display nativeGetPrinterDialogDefault:false
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16257
    "
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16258
!
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 16259
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16260
nativeInformationOK:aString title:titleString
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16261
     ^ self
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 16262
	    nativeConfirm:aString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 16263
	    title:titleString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 16264
	    flags:#( APPLMODAL ICONINFORMATION OK)
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 16265
	    initialAnswer:nil
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 16266
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 16267
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 16268
      Screen current
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 16269
	nativeInformationOK:'Some Info' title:'Info'
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 16270
     "
4732
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 16271
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 16272
    "Modified: / 02-03-2007 / 15:37:40 / cg"
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 16273
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 16274
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16275
nativeMessageBoxFor:ownerId text:textOrNil title:titleOrNil flags:flagArray blocking:blocking
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16276
    "start a native message box dialog.
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16277
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16278
     EXPERIMENTAL & non-portable: use with caution"
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16279
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16280
    |errorCode answer|
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16281
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16282
%{  /* STACK: 32000*/
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16283
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16284
#ifndef NO_NATIVE_DIALOGS
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16285
    HWND hWndOwner = NULL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16286
    int boxFlags = 0;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16287
    char *__title;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16288
    char *__text;
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 16289
    INT __answer;
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16290
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16291
    if (__isExternalAddress(ownerId)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16292
	hWndOwner = _HWNDVal(ownerId);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16293
    }
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 16294
    if (__isStringLike(titleOrNil)) {
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16295
	__title = __stringVal(titleOrNil);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16296
    } else {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16297
	__title = "";
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16298
    }
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 16299
    if (__isStringLike(textOrNil)) {
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16300
	__text = __stringVal(textOrNil);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16301
    } else {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16302
	__text = "";
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16303
    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16304
4405
f4c62bb63035 isArrayLike to support immutable arrays
Claus Gittinger <cg@exept.de>
parents: 4388
diff changeset
 16305
    if (__isNonNilObject(flagArray) && __isArrayLike(flagArray)) {
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 16306
	unsigned int i;
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16307
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16308
	for (i=0; i<__arraySize(flagArray); i++) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16309
	    OBJ flag = __ArrayInstPtr(flagArray)->a_element[i];
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16310
	    int flagVal = 0;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16311
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16312
	    if (__isSmallInteger(flag)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16313
		flagVal = __intVal(flag);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16314
	    } else if (flag == @symbol(ABORTRETRYIGNORE)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16315
		flagVal = MB_ABORTRETRYIGNORE;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16316
	    } else if (flag == @symbol(APPLMODAL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16317
		flagVal = MB_APPLMODAL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16318
	    } else if (flag == @symbol(DEFAULT_DESKTOP_ONLY)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16319
		flagVal = MB_DEFAULT_DESKTOP_ONLY;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16320
	    } else if (flag == @symbol(DEFBUTTON1)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16321
		flagVal = MB_DEFBUTTON1;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16322
	    } else if (flag == @symbol(DEFBUTTON2)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16323
		flagVal = MB_DEFBUTTON2;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16324
	    } else if (flag == @symbol(DEFBUTTON3)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16325
		flagVal = MB_DEFBUTTON3;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16326
	    } else if (flag == @symbol(ICONASTERISK)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16327
		flagVal = MB_ICONASTERISK;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16328
	    } else if (flag == @symbol(ICONHAND)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16329
		flagVal = MB_ICONHAND;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16330
	    } else if (flag == @symbol(ICONINFORMATION)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16331
		flagVal = MB_ICONINFORMATION;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16332
	    } else if (flag == @symbol(ICONQUESTION)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16333
		flagVal = MB_ICONQUESTION;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16334
	    } else if (flag == @symbol(ICONSTOP)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16335
		flagVal = MB_ICONSTOP;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16336
	    } else if (flag == @symbol(OK)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16337
		flagVal = MB_OK;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16338
	    } else if (flag == @symbol(OKCANCEL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16339
		flagVal = MB_OKCANCEL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16340
	    } else if (flag == @symbol(RETRYCANCEL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16341
		flagVal = MB_RETRYCANCEL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16342
	    } else if (flag == @symbol(SETFOREGROUND)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16343
		flagVal = MB_SETFOREGROUND;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16344
	    } else if (flag == @symbol(SYSTEMMODAL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16345
		flagVal = MB_SYSTEMMODAL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16346
	    } else if (flag == @symbol(TASKMODAL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16347
		flagVal = MB_TASKMODAL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16348
	    } else if (flag == @symbol(YESNO)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16349
		flagVal = MB_YESNO;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16350
	    } else if (flag == @symbol(YESNOCANCEL)) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16351
		flagVal = MB_YESNOCANCEL;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16352
	    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16353
	    boxFlags |= flagVal;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16354
	}
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16355
    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16356
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16357
    if (blocking == true) {
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16358
	__answer = MessageBox(hWndOwner,
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 16359
			      __text,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 16360
			      __title,
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 16361
			      boxFlags);
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16362
    } else {
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 16363
	do {
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 16364
	    __threadErrno = 0;
6067
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 16365
	    __answer = (INT) __STX_API_CALL4(
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 16366
					"MessageBox",
7509
d18f375ac80d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7472
diff changeset
 16367
					(voidFUNC)MessageBox,
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16368
					(void *)hWndOwner,
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 16369
					(void *)__text,
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 16370
					(void *)__title,
6067
fde3a2b3eb4e gcc warnings
Claus Gittinger <cg@exept.de>
parents: 6040
diff changeset
 16371
					(void *)((INT)boxFlags));
3583
85cacfd02787 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3582
diff changeset
 16372
	} while ((__answer < 0) && (__threadErrno == EINTR));
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16373
    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16374
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16375
    switch (__answer) {
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16376
	case IDABORT:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16377
	    answer = @symbol(IDABORT);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16378
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16379
	case IDCANCEL:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16380
	    answer = @symbol(IDCANCEL);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16381
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16382
	case IDIGNORE:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16383
	    answer = @symbol(IDIGNORE);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16384
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16385
	case IDNO:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16386
	    answer = @symbol(IDNO);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16387
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16388
	case IDOK:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16389
	    answer = @symbol(IDOK);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16390
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16391
	case IDRETRY:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16392
	    answer = @symbol(IDRETRY);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16393
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16394
	case IDYES:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16395
	    answer = @symbol(IDYES);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16396
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16397
	default:
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16398
	    answer = __MKSMALLINT(__answer);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16399
	    break;
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16400
    }
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16401
#else
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16402
    errorCode = __MKSMALLINT(-1);
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16403
#endif /* NO_NATIVE_DIALOGS */
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16404
%}.
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16405
    (errorCode notNil) ifTrue:[
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16406
	self primitiveFailed.
3718
6818104e175e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
 16407
	^ nil
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16408
    ].
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16409
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16410
    ^ answer
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16411
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16412
    "
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16413
     Display
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16414
	nativeMessageBoxFor:nil
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16415
	text:'Hello world'
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16416
	title:'Message'
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16417
	flags:#( OK APPLMODAL ICONSTOP )
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16418
	blocking:true
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16419
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16420
     Display
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16421
	nativeMessageBoxFor:nil
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16422
	text:'Hello world'
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16423
	title:'Message'
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16424
	flags:#( OK APPLMODAL ICONSTOP )
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16425
	blocking:false
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16426
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16427
     Display
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16428
	nativeMessageBoxFor:nil
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16429
	text:'Hello world'
3570
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16430
	title:'Message'
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16431
	flags:#( ABORTRETRYIGNORE ICONSTOP )
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16432
	blocking:false
b48b4f789317 event handling (min/max);
Claus Gittinger <cg@exept.de>
parents: 3564
diff changeset
 16433
    "
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 16434
!
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 16435
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16436
nativeWarnOK:aString title:titleString
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 16437
     ^ self
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 16438
	    nativeConfirm:aString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 16439
	    title:titleString
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 16440
	    flags:#( APPLMODAL ICONSTOP OK)
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 16441
	    initialAnswer:nil
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 16442
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 16443
     "
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 16444
      Screen current
4745
778644e0c89b Can compile with MS Visual C++ 8 / 2005
Stefan Vogel <sv@exept.de>
parents: 4732
diff changeset
 16445
	nativeWarnOK:'some warning' title:'Warning'
3571
7b97a1b3ff80 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3570
diff changeset
 16446
     "
4732
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 16447
b5bdb640655a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4729
diff changeset
 16448
    "Modified: / 02-03-2007 / 15:37:47 / cg"
3508
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 16449
! !
6d320fc07f4f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3506
diff changeset
 16450
4238
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16451
!WinWorkstation methodsFor:'native widget support'!
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16452
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16453
nativeDialogs
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16454
    ^ NativeDialogs ? false
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16455
!
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16456
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16457
nativeDialogs:aBoolean
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16458
    "enable / disable use of native dialogs.
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16459
     This is an experimental, unfinished, unsupported feature.
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16460
     For now, this only affects some file-, warning-, information and confirmation dialogs."
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16461
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16462
    NativeDialogs := aBoolean
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16463
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16464
    "
4240
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 16465
     Screen current nativeDialogs:true
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 16466
     Screen current nativeDialogs:false
4238
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16467
    "
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16468
!
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16469
5598
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16470
nativeFileDialogs
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16471
    ^ NativeFileDialogs ? false
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16472
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16473
    "Created: / 24-08-2010 / 16:41:13 / sr"
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16474
!
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16475
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16476
nativeFileDialogs:aBoolean
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16477
    "enable / disable use of native file dialogs.
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16478
     This is an experimental, unfinished, unsupported feature.
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16479
     For now, this only affects some file dialogs."
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16480
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16481
    NativeFileDialogs := aBoolean
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16482
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16483
    "
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16484
     Screen current nativeFileDialogs:true
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16485
     Screen current nativeFileDialogs:false
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16486
    "
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16487
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16488
    "Created: / 24-08-2010 / 16:41:36 / sr"
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16489
!
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16490
4261
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 16491
nativeWidgets
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 16492
    ^ NativeWidgets ? false
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 16493
!
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 16494
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 16495
nativeWidgets:aBoolean
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 16496
    "enable / disable use of native widgets.
4238
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16497
     This is an experimental, unfinished, unsupported feature.
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16498
     For now, this only affects some widgets."
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16499
4261
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 16500
    NativeWidgets := aBoolean
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 16501
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 16502
    "
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 16503
     Screen current nativeWidgets:true
0eed7aee7d20 *** empty log message ***
ca
parents: 4257
diff changeset
 16504
     Screen current nativeWidgets:false
4238
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16505
    "
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16506
!
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16507
4263
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 16508
supportsNativeDialogs
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 16509
    ^ true
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 16510
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 16511
    "
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 16512
     Screen current supportsNativeDialogs
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 16513
    "
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 16514
!
d9dbe59481dd *** empty log message ***
ca
parents: 4262
diff changeset
 16515
5598
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16516
supportsNativeFileDialogs
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16517
    ^ true
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16518
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16519
    "
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16520
     Screen current supportsNativeFileDialogs
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16521
    "
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16522
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16523
    "Created: / 24-08-2010 / 16:28:42 / sr"
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16524
!
00f301327c83 added #nativeFileDialog
sr
parents: 5596
diff changeset
 16525
4238
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16526
supportsNativeWidgets
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16527
    ^ true
4240
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 16528
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 16529
    "
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 16530
     Screen current supportsNativeWidgets
d51a36bff70e *** empty log message ***
ca
parents: 4239
diff changeset
 16531
    "
4238
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16532
! !
c0bb223e53be *** empty log message ***
ca
parents: 4237
diff changeset
 16533
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16534
!WinWorkstation methodsFor:'pointer queries '!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16535
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16536
anyButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16537
    "return an integer for masking out any button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16538
     buttonStates value."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16539
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16540
    "/ should use ``Display buttonXMotionMask bitOr:....''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16541
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16542
%{  /* NOCONTEXT */
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 16543
    RETURN ( __MKSMALLINT(AnyButtonMask) );
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16544
%}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16545
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16546
    "Modified: 23.3.1996 / 12:41:33 / cg"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16547
    "Created: 23.3.1996 / 12:46:35 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16548
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16549
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16550
buttonStates
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16551
    "return an integer representing the state of the pointer buttons;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16552
     a one-bit in positions 0.. represent a pressed button.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16553
     See the button1Mask/button2Mask/button3Mask,
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16554
     shiftMask/controlMask and modifierMask methods for the meaning of the bits."
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16555
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 16556
%{  /* NOCONTEXT */
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16557
    int modifiers = 0;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16558
    int b1m = Button1Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16559
    int b3m = Button3Mask;
2688
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 16560
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 16561
    if (GetSystemMetrics(SM_SWAPBUTTON)) {
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 16562
	b3m = Button1Mask;
21f9fac6292a eat buttonPress event on activate;
Claus Gittinger <cg@exept.de>
parents: 2684
diff changeset
 16563
	b1m = Button3Mask;
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16564
    }
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16565
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16566
    if (GetAsyncKeyState(VK_LBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16567
	modifiers |= b1m;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16568
    if (GetAsyncKeyState(VK_MBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16569
	modifiers |= Button2Mask;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16570
    if (GetAsyncKeyState(VK_RBUTTON) & 0x8000)
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16571
	modifiers |= b3m;
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 16572
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 16573
    RETURN (__MKSMALLINT(modifiers));
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 16574
%}
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16575
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16576
    "
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16577
     Display buttonStates
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16578
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16579
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16580
    "is the control-key pressed ?
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16581
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16582
     Display buttonStates bitTest:(Display controlMask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16583
    "
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16584
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16585
    "is the alt/meta-key pressed ?
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16586
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16587
     Display buttonStates bitTest:(Display altModifierMask)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16588
     Display buttonStates bitTest:(Display metaModifierMask)
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16589
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16590
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16591
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16592
leftButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16593
    "return an integer for masking out the left button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16594
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16595
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16596
    "/ should use ``Display button1MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16597
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16598
%{  /* NOCONTEXT */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16599
    RETURN ( __MKSMALLINT(Button1Mask) );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16600
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16601
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16602
    "Modified: 23.3.1996 / 12:41:33 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16603
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16604
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16605
middleButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16606
    "return an integer for masking out the middle button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16607
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16608
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16609
    "/ should use ``Display button2MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16610
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16611
%{  /* NOCONTEXT */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16612
    RETURN ( __MKSMALLINT(Button2Mask) );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16613
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16614
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16615
    "Modified: 23.3.1996 / 12:41:43 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16616
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16617
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16618
pointerPosition
2743
e8ec65f5a42b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
 16619
    "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
 16620
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 16621
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16622
    POINT p;
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16623
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16624
    if (! GetCursorPos(&p)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16625
	p.x = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16626
	p.y = 0;
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16627
    }
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16628
    RETURN (__MKPOINT_INT(p.x, p.y));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16629
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16630
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16631
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16632
rightButtonStateMask
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16633
    "return an integer for masking out the right button from a
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16634
     buttonStates value"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16635
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16636
    "/ should use ``Display button3MotionMask''
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16637
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16638
%{  /* NOCONTEXT */
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16639
    RETURN ( __MKSMALLINT(Button3Mask) );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16640
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16641
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16642
    "Modified: 23.3.1996 / 12:41:52 / cg"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16643
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16644
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16645
rootPositionOfLastEvent
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16646
    "return the position in root-window coordinates
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16647
     of the last button, key or pointer event"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16648
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 16649
%{  /* NOCONTEXT */
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16650
    RETURN (__MKPOINT_INT(evRootX, evRootY));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16651
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16652
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16653
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16654
setPointerPosition:newPosition
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16655
    "change the pointer position in root-window coordinates."
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16656
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 16657
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16658
    if (__isPoint(newPosition)) {
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16659
	OBJ xpos, ypos;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16660
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16661
	xpos = __point_X(newPosition);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16662
	ypos = __point_Y(newPosition);
2434
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16663
	if (__bothSmallInteger(xpos, ypos)) {
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16664
	    SetCursorPos(__intVal(xpos), __intVal(ypos));
ac2a149ed9cc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2424
diff changeset
 16665
	}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16666
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16667
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16668
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16669
1723
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16670
setPointerPosition:newPosition in:aWindowId
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16671
    "change the pointer position to a new position relative to the
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16672
     given windows origin (which may be the rootWindow).
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16673
     Be careful with this - its usually not very ergonimically
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16674
     to change the mousePointer position.
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16675
     This interface is provided for special applications (presentation
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16676
     playback) and should not be used in normal applications."
dd0862bde826 not bad ....
Claus Gittinger <cg@exept.de>
parents: 1706
diff changeset
 16677
3895
31caf29bcda1 there is no setCursorPosition (?!)
Claus Gittinger <cg@exept.de>
parents: 3850
diff changeset
 16678
"/    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
 16679
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16680
5515
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16681
!WinWorkstation methodsFor:'private error handling'!
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16682
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16683
textOutFailed
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16684
    "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
 16685
     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
 16686
     GetLastError is 5"
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16687
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16688
    "/ self error:'textOut failed'.
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16689
! !
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 16690
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16691
!WinWorkstation methodsFor:'retrieving pixels'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 16692
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16693
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
 16694
    "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
 16695
     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
 16696
     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
 16697
     number of bytes per scanline. The number of bytes per scanline is not known
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16698
     in advance, since the Workstation is free to return whatever it thinks is a good padding."
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16699
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16700
    |error bytesPerLine bitmapPad bitsPerPixel|
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16701
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 16702
    ((w <= 0) or:[h <= 0]) ifTrue:[
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16703
	^ self primitiveFailed:'zero width or height'.
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16704
    ].
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16705
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16706
%{
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16707
    int     height, width;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16708
    unsigned int numBytes;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16709
    int     bytesPerRow;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16710
    HWND    hWnd;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16711
    HBITMAP hBitmap = 0;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16712
    HGDIOBJ hPrevious = 0;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16713
    HDC     bDC = 0;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16714
    struct {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16715
	BITMAPINFOHEADER bmiHeader;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16716
	DWORD r;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16717
	DWORD g;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16718
	DWORD b;
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16719
    } bitmap;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16720
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16721
    if (! __isExternalAddress(aDrawableId)) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16722
	error = __MKSTRING("externalAddress arg");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16723
	goto out;
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16724
    }
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16725
    if (! __bothSmallInteger(srcX, srcY)) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16726
	error = __MKSTRING("x,y args");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16727
	goto out;
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16728
    }
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16729
    if (! __bothSmallInteger(w, h)) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16730
	error = __MKSTRING("w,h args");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16731
	goto out;
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16732
    }
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16733
    if (! __isByteArray(imageBits)) {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16734
	error = __MKSTRING("imageBits arg");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16735
	goto out;
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16736
    }
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16737
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16738
    {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16739
	hWnd = _HWNDVal( aDrawableId );
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16740
	BMDPRINTF(("primGetBits %x\n",hWnd));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16741
	if ( hWnd != 0 ) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16742
	    HDC wDC;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16743
	    HANDLE prevBitmap;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16744
	    int widthRoundedUpToNextMultipleOf4 = ((width + 3 ) / 4) * 4;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16745
	    int widthUsed;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16746
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16747
	    bDC = CreateCompatibleDC(__rootDC);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16748
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16749
	    BMDPRINTF(("primGetBits srcX %d srcY %d w %d h %d\n",__intVal(srcX),__intVal(srcY),__intVal(w),__intVal(h)));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16750
	    height =  __intVal(h);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16751
	    width  =  __intVal(w);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16752
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16753
	    widthUsed = widthRoundedUpToNextMultipleOf4;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16754
	    widthUsed = width;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16755
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16756
	    BMDPRINTF(("width %d height %d\n",width,height));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16757
	    hBitmap = CreateCompatibleBitmap(__rootDC, widthUsed, height);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16758
	    if (!hBitmap) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16759
		error = __MKSTRING("CreateCompatibleBitmap failed");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16760
		goto out;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16761
	    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16762
	    bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16763
	    bitmap.bmiHeader.biPlanes = 1;
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16764
#ifdef ALWAYSTRUECOLOR
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16765
	    bitmap.bmiHeader.biCompression = BI_RGB;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16766
	    bytesPerRow = (((width*3) + 3 ) / 4) * 4;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16767
#else
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16768
	    if (__depth == 24) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16769
		bitmap.bmiHeader.biCompression = BI_RGB;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16770
		bytesPerRow = (((width*3) + 3 ) / 4) * 4;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16771
	    } else if (__depth == 16) {
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16772
# if 0
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16773
		bitmap.bmiHeader.biCompression = BI_BITFIELDS;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16774
		bitmap.b = 0x001f;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16775
		bitmap.g = 0x07e0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16776
		bitmap.r = 0xf800;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16777
		bytesPerRow = (((width*2) + 1 ) / 4) * 4;
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16778
# else
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16779
		bitmap.b = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16780
		bitmap.g = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16781
		bitmap.r = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16782
		bitmap.bmiHeader.biCompression = BI_RGB;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16783
		bytesPerRow = (((width*3) + 3 ) / 4) * 4;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16784
# endif
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16785
	    }
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16786
#endif /* ALWAYSTRUECOLOR */
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16787
	    bitmap.bmiHeader.biSizeImage = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16788
	    bitmap.bmiHeader.biXPelsPerMeter = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16789
	    bitmap.bmiHeader.biYPelsPerMeter = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16790
	    bitmap.bmiHeader.biClrUsed = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16791
	    bitmap.bmiHeader.biClrImportant = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16792
	    bitmap.bmiHeader.biBitCount = __depth;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16793
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16794
	    bitmap.bmiHeader.biWidth = widthUsed;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16795
	    bitmap.bmiHeader.biHeight = -height;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16796
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16797
	    wDC = GetDC(hWnd);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16798
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16799
	    hPrevious = SelectObject(bDC, hBitmap);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16800
	    if (BitBlt(bDC,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16801
		   0,0,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16802
		   width,height,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16803
		   wDC,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16804
		   __intVal(srcX), __intVal(srcY),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16805
		   SRCCOPY|CAPTUREBLT)
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16806
		 == 0
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16807
		)
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16808
	    {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16809
		INFOFPRINTF((stderr, "WinWorkstation [warning]: in primGetBitsFrom: BitBlt\n"));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16810
	    }
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16811
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16812
#ifdef CACHE_LAST_DC
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16813
	    if (lastGcData && (lastGcData->_hDC == wDC)) {
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16814
# ifdef DEBUG_DC_REUSE
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16815
		console_fprintf(stderr, "WinWorkstation [info]: Oops - dont release - cachedDC reuse\n", __LINE__);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16816
# endif
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16817
	    } else
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16818
#endif
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16819
	    {
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16820
#ifdef CACHE_LAST_WM_PAINT_DC
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16821
		if (last_wm_paint_dc && (last_wm_paint_dc == wDC)) {
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16822
# ifdef DEBUG_DC_REUSE
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16823
		    console_fprintf(stderr, "WinWorkstation [info]: Oops - dont release - last_wm_paint_dc reuse\n", __LINE__);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16824
# endif
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16825
		} else
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16826
#endif
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16827
		{
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16828
		    ReleaseDC(hWnd, wDC);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16829
		}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16830
	    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16831
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16832
	    if (GetDIBits(bDC,hBitmap,0,height,0,(struct tagBITMAPINFO *)&bitmap,DIB_RGB_COLORS) == 0)
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16833
	    {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16834
		error = __MKSTRING("noinfo returned in primGetBits");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16835
		goto out;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16836
	    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16837
	    BMDPRINTF(("bitmap info:%d %d %d %d\n",
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16838
			bitmap.bmiHeader.biWidth, bitmap.bmiHeader.biHeight,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16839
			bitmap.bmiHeader.biBitCount, bitmap.bmiHeader.biSizeImage));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16840
	    numBytes = bitmap.bmiHeader.biSizeImage;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16841
	    if ( numBytes != 0 ) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16842
		if (numBytes > __byteArraySize(imageBits)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16843
		    /* imageBits too small */
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16844
		    INFOFPRINTF((stderr, "WinWorkstation [warning]: primGetBits - byteArray too small (is:%d need:%d; w:%d h:%d)\n",
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16845
				__byteArraySize(imageBits), numBytes,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16846
				bitmap.bmiHeader.biWidth, -bitmap.bmiHeader.biHeight
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16847
			     ));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16848
		    error = __MKSTRING("byteArray too small");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16849
		    goto out;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16850
		}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16851
		BMDPRINTF(("numBytes %d\n",numBytes));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16852
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16853
		bitmap.bmiHeader.biHeight = -height;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16854
		if (GetDIBits(bDC,hBitmap,0,height,__ByteArrayInstPtr(imageBits)->ba_element,(struct tagBITMAPINFO *)&bitmap,DIB_RGB_COLORS) == 0)
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16855
		{
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16856
		    error = __MKSTRING("zero bits returned in primGetBits");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16857
		    goto out;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16858
		}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16859
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16860
		/* swap red and blue (windows delivers BGR) */
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16861
		{
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16862
		    char *cp = __ByteArrayInstPtr(imageBits)->ba_element;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16863
		    int _h;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16864
		    char *rowp = cp;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16865
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16866
		    for (_h=height; _h>0; _h--) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16867
			int _w;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16868
			char *pixel = rowp;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16869
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16870
			for (_w=width; _w>0; _w--) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16871
			    char b;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16872
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16873
			    b = pixel[0];
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16874
			    pixel[0] = pixel[2];
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16875
			    pixel[2] = b;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16876
			    pixel += 3;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16877
			};
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16878
			rowp += bytesPerRow;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16879
		    };
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16880
		}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16881
	    } else {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16882
		error = __MKSTRING("unacceptable bitmap in primGetBits");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16883
		goto out;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16884
	    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16885
	} else {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16886
	    error = __MKSTRING("unacceptable HWND in primGetBits");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16887
	    goto out;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16888
	}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16889
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16890
	bytesPerLine = __MKSMALLINT(bytesPerRow);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16891
	bitmapPad = __MKSMALLINT(WIN32PADDING);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16892
	bitsPerPixel = __MKSMALLINT(bitmap.bmiHeader.biBitCount);
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16893
    }
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16894
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16895
out:
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16896
    if ((hPrevious != NULL) && (bDC != NULL))
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16897
	SelectObject(bDC, hPrevious);
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16898
    if (bDC)
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16899
	DeleteDC(bDC);
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16900
    if (hBitmap)
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16901
	_DeleteObject(hBitmap, __LINE__);
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16902
%}.
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16903
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16904
    error notNil ifTrue:[
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16905
	^ self primitiveFailed:error.
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16906
    ].
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16907
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16908
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16909
    ^ IdentityDictionary new
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16910
	    at:#bitOrder put:#msbFirst;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16911
	    at:#depth put:1;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16912
	    at:#bytesPerLine put:bytesPerLine;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16913
	    at:#byteOrder put:#lsbFirst;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16914
	    at:#format put:#XYPixmap;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16915
	    at:#bitmapUnit put:0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16916
	    at:#bitmapPad put:bitmapPad;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16917
	    at:#bitsPerPixel put:bitsPerPixel;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16918
	    at:#redMask put:16rFF0000;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16919
	    at:#greenMask put:16r00FF00;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16920
	    at:#blueMask put:16r0000FF;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16921
	    yourself.
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16922
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16923
    "Modified (comment): / 28-03-2017 / 14:28:39 / stefan"
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16924
!
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16925
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16926
getBitsFromPixmapId:aDrawableId x:srcX y:srcY width:w height:h into:imageBits
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16927
    "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
 16928
     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
 16929
     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
 16930
     number of bytes per scanline. The number of bytes per scanline is not known
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16931
     in advance, since the Workstation is free to return whatever it thinks is a good padding."
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16932
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16933
    |rawInfo error bytesPerLine format bitmapPad bitsPerPixel|
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16934
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16935
    ((w <= 0) or:[h <= 0]) ifTrue:[
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16936
	self primitiveFailed:'zero width or height'.
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16937
	^ nil
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16938
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 16939
3562
7b8bb39f9332 fixed pixmap readout for win32, where red and green are exchanged
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
 16940
    rawInfo := Array new:11.
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16941
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16942
%{
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16943
    int            height, width;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16944
    unsigned int   numBytes;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16945
    unsigned char* ep = 0;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16946
    HBITMAP        xBitmap;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16947
    HBITMAP hBitmap = 0;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16948
    HDC bDC = 0;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16949
    HDC xDC = 0;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16950
    struct
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16951
    {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16952
	BITMAPINFOHEADER bmiHeader;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16953
	DWORD rgb[2];
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16954
    } bitmap;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16955
    BITMAP bitmapInfo;
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16956
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16957
    if (__isExternalAddress(aDrawableId)
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16958
     && __bothSmallInteger(srcX, srcY)
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16959
     && __bothSmallInteger(w, h)
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16960
     && __isArray(rawInfo) && __arraySize(rawInfo) >= 11
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16961
     && __isByteArray(imageBits))
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16962
    {
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16963
	xBitmap = _HBITMAPVAL( aDrawableId );
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16964
	BMDPRINTF(("primGetBitsFromPixmap %x\n",xBitmap));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16965
	if (xBitmap != 0) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16966
	    xDC = GetDC(0);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16967
	    SelectObject(xDC, xBitmap);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16968
	    GetObject(xBitmap,sizeof(bitmapInfo),&bitmapInfo);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16969
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16970
	    bDC = CreateCompatibleDC(__rootDC);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16971
	    BMDPRINTF(("srcX %d srcY %d w %d h %d\n",__intVal(srcX),__intVal(srcY),__intVal(w),__intVal(h)));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16972
	    height =  __intVal(h);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16973
	    width  =  __intVal(w);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16974
	    BMDPRINTF(("width %d height %d\n",width,height));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16975
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16976
	    hBitmap = CreateCompatibleBitmap(xDC, width, height);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16977
	    if (!hBitmap) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16978
		error = __MKSTRING("create bitmap failed");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16979
		goto out;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16980
	    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16981
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16982
	    SelectObject(bDC,hBitmap);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16983
	    if (BitBlt(bDC,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16984
		   0,0,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16985
		   width,height,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16986
		   xDC,
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16987
		   __intVal(srcX), __intVal(srcY),
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16988
		   SRCCOPY)
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16989
		 == 0
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16990
		)
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16991
	    {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16992
		error = __MKSTRING("BitBlt failed");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16993
		goto out;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16994
	    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16995
	    bitmap.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16996
	    bitmap.bmiHeader.biPlanes = 1;
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 16997
#ifdef ALWAYSTRUECOLOR
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16998
	    bitmap.bmiHeader.biCompression = BI_RGB;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 16999
#else
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17000
	    if (__depth == 24) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17001
		/*bitmap.bmiHeader.biCompression = BI_BITFIELDS;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17002
		bitmap.r = 0xff0000;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17003
		bitmap.g = 0x00ff00;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17004
		bitmap.b = 0x0000ff;*/
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17005
		bitmap.bmiHeader.biCompression = BI_RGB;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17006
	    } else if (__depth == 16) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17007
		bitmap.b = 0x001f;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17008
		bitmap.g = 0x07e0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17009
		bitmap.r = 0xf800;*/
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17010
		bitmap.bmiHeader.biCompression = BI_RGB;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17011
	    } else {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17012
		error = __MKSTRING("primGetBitsFromPixmap: unsupported depth");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17013
		got fail;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17014
	    }
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17015
#endif /* ALWAYSTRUECOLOR */
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17016
	    bitmap.bmiHeader.biSizeImage = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17017
	    bitmap.bmiHeader.biXPelsPerMeter = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17018
	    bitmap.bmiHeader.biYPelsPerMeter = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17019
	    bitmap.bmiHeader.biClrUsed = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17020
	    bitmap.bmiHeader.biClrImportant = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17021
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17022
	    bitmap.bmiHeader.biWidth = width;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17023
	    bitmap.bmiHeader.biHeight = -height;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17024
	    bitmap.bmiHeader.biBitCount = bitmapInfo.bmBitsPixel;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17025
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17026
	    if (GetDIBits(bDC,hBitmap,0,height,0,(struct tagBITMAPINFO *)&bitmap,DIB_RGB_COLORS) == 0)
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17027
	    {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17028
		error = __MKSTRING("GetDIBits failed");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17029
		goto out;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17030
	    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17031
	    BMDPRINTF(("bitmap info:%d %d %d %d\n",bitmap.bmiHeader.biWidth,bitmap.bmiHeader.biHeight,bitmap.bmiHeader.biBitCount,bitmap.bmiHeader.biSizeImage));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17032
	    numBytes = bitmap.bmiHeader.biSizeImage;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17033
	    if ( numBytes != 0 ) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17034
		if (numBytes > __byteArraySize(imageBits)) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17035
		    /* imageBits too small */
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17036
		    error = __MKSTRING("provided byteArray too small");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17037
		    goto out;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17038
		}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17039
		BMDPRINTF(("numBytes %d\n",numBytes));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17040
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17041
		bitmap.bmiHeader.biHeight = -height;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17042
		bitmap.bmiHeader.biBitCount = bitmapInfo.bmBitsPixel; /*__depth;*/
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17043
		bitmap.rgb[0] = 0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17044
		bitmap.rgb[1] = 0xffffff;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17045
		if (GetDIBits(xDC,xBitmap,0,height,__ByteArrayInstPtr(imageBits)->ba_element,(struct tagBITMAPINFO *)&bitmap,DIB_RGB_COLORS) == 0)
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17046
		{
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17047
		    BMDPRINTF(("zero bits returned\n"));
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17048
		    error = __MKSTRING("zero bits returned");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17049
		    goto out;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17050
		}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17051
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17052
#if 0
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17053
		{
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17054
		    /* swap red and blue (windows delivers BGR) */
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17055
		    char *cp = __ByteArrayInstPtr(imageBits)->ba_element;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17056
		    int n = numBytes;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17057
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17058
		    for ( ;n > 0; n -= 3, cp += 3) {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17059
			  char b = cp[0];
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17060
			  cp[0] = cp[2];
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17061
			  cp[2] = b;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17062
		    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17063
		}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17064
#endif
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17065
	    } else {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17066
		error = __MKSTRING("unacceptable bitmap (size is 0 bytes)");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17067
		goto out;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17068
	    }
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17069
	} else {
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17070
	    error = __MKSTRING("unacceptable bitmap (null xBitmap)");
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17071
	    goto out;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17072
	}
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17073
	bytesPerLine = __MKSMALLINT(numBytes/height);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17074
	format = (bitmap.bmiHeader.biBitCount == 1) ? @symbol(ZPixmap) : @symbol(XYPixmap);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17075
	bitmapPad = __MKSMALLINT(WIN32PADDING);
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17076
	bitsPerPixel = __MKSMALLINT(bitmap.bmiHeader.biBitCount);
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17077
    }
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17078
out:
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17079
    if (bDC)
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17080
	DeleteDC(bDC);
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17081
    if (xDC)
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17082
	ReleaseDC(0, xDC); //DeleteDC(xDC);
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17083
    if (hBitmap)
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17084
	DeleteObject(hBitmap);
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17085
%}.
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17086
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17087
    error notNil ifTrue:[
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17088
	self primitiveFailed:error.
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17089
    ].
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17090
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17091
    ^ IdentityDictionary new
8015
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17092
	    at:#bitOrder put:#msbFirst;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17093
	    at:#depth put:1;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17094
	    at:#bytesPerLine put:bytesPerLine;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17095
	    at:#byteOrder put:#lsbFirst;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17096
	    at:#format put:format;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17097
	    at:#bitmapUnit put:0;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17098
	    at:#bitmapPad put:bitmapPad;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17099
	    at:#bitsPerPixel put:bitsPerPixel;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17100
	    at:#redMask put:16rFF0000;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17101
	    at:#greenMask put:16r00FF00;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17102
	    at:#blueMask put:16r0000FF;
Claus Gittinger <cg@exept.de>
parents: 8014
diff changeset
 17103
	    yourself.
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17104
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 17105
    "Modified (comment): / 28-03-2017 / 14:28:46 / stefan"
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17106
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17107
4539
d3aeb93c103b preps for print-dc
Claus Gittinger <cg@exept.de>
parents: 4523
diff changeset
 17108
getPixelX:px y:py from:ignoredDrawableId with:aGCId
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17109
    "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
 17110
     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
 17111
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17112
%{  /* NOCONTEXT */
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17113
    if (__isExternalAddress(aGCId)
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17114
     && __bothSmallInteger(px, py)) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17115
	struct gcData *gcData = _GCDATA(aGCId);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17116
	HDC hDC;
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17117
	int __x = __intVal(px), __y = __intVal(py);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17118
	int pixel;
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17119
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17120
	hDC = _getDC(gcData);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17121
	pixel = GetPixel(hDC, __x, __y);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17122
#ifndef CACHE_LAST_DC
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17123
	_releaseDC(gcData);
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17124
#endif
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17125
	/*
4235
e90c1cad5151 *** empty log message ***
ca
parents: 4232
diff changeset
 17126
	 * for compatibility, returns the pixelValue
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17127
	 * from a monochrome bitmap
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17128
	 */
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17129
	if (gcData->hBitmap) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17130
	    if (gcData->bitmapColorBitCount == 1) {
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17131
		pixel = (pixel == 0) ? 0 : 1;
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17132
	    }
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17133
	}
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17134
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17135
	RETURN ( __MKSMALLINT(pixel & 0xFFFFFF) );
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17136
    }
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 17137
%}.
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17138
    ^ nil
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17139
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17140
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17141
!WinWorkstation methodsFor:'style defaults'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17142
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17143
defaultStyleValueFor:aKey
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17144
    "return a default style value, given a key.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17145
     These defaults are used if nothing is specified
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17146
     in the style sheet
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17147
     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
 17148
     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
 17149
     where the systemDefaults are used ..."
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17150
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17151
    |clr|
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17152
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17153
"/    aKey == #shadowColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17154
"/        ^ Color black
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17155
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17156
"/    aKey == #lightColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17157
"/        ^ Color white
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17158
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17159
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17160
    aKey == #viewBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17161
	clr := self getSystemColor:#COLOR_WINDOW.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17162
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17163
    aKey == #textForegroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17164
	clr := self getSystemColor:#COLOR_WINDOWTEXT
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17165
    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17166
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17167
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17168
"/    aKey == #scrollerViewBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17169
"/        ^ Color white
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17170
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17171
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17172
"/    aKey == #textBackgroundColor ifTrue:[
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17173
"/        ^ Color white.
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17174
"/    ].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17175
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17176
    clr notNil ifTrue:[^ clr].
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17177
    ^ super defaultStyleValueFor:aKey
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17178
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17179
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17180
!WinWorkstation methodsFor:'tray access'!
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17181
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17182
addTrayIconFor:aView
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17183
	icon:wicon iconMask:wiconMaskArg
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17184
	toolTipMessage:toolTipMessageArg
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17185
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17186
    "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
 17187
     The icon, mask and toolTopText are optional.
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17188
     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
 17189
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17190
    |windowId wiconId wiconMask invertedWiconMask wiconMaskId
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17191
     wiconWidth wiconHeight toolTipMessage|
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17192
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17193
    "/ 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
 17194
    toolTipMessageArg size > 63 ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17195
	toolTipMessage := toolTipMessageArg copyTo:63
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17196
    ] ifFalse:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17197
	toolTipMessage := toolTipMessageArg.
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17198
    ].
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17199
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17200
    windowId := aView id.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17201
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17202
    wicon notNil ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17203
	wiconId := (wicon asFormOn:self) id.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17204
	wiconHeight := wicon height.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17205
	wiconWidth  := wicon width.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17206
	wiconMask := wiconMaskArg.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17207
	wiconMask isNil ifTrue:[
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17208
	    wiconMask := wicon mask.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17209
	].
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17210
	wiconMask notNil ifTrue:[
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17211
	    "/ WIN32's mask has zeros for opaque pixels
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17212
	    invertedWiconMask := wiconMask copy.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17213
	    invertedWiconMask bits invert.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17214
	    invertedWiconMask := invertedWiconMask onDevice:self.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17215
	    wiconMaskId := invertedWiconMask id
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17216
	].
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17217
    ].
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17218
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17219
%{  /* STACK: 20000 */
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17220
#ifndef WM_TRAY_MESSAGE
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17221
# define WM_TRAY_MESSAGE (WM_USER+0x200)
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17222
#endif
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17223
    HBITMAP        xBitMap, maskBitmap;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17224
    HICON          xIcon = (HICON)0;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17225
    ICONINFO       iconInfo;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17226
    NOTIFYICONDATA nid;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17227
    unsigned char fastBits[10000];
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17228
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17229
    /* get bitmap for icon */
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17230
    if ( __isExternalAddress(wiconId) ) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17231
	xBitMap = _HBITMAPVAL( wiconId );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17232
	if ( xBitMap != 0 ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17233
	    BITMAP bm;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17234
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17235
	    if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17236
		int d = bm.bmPlanes * bm.bmBitsPixel;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17237
		BYTE *ep;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17238
		int height, width;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17239
		int nBytes;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17240
		unsigned char *allocatedBits = 0;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17241
		int privateMask = 0;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17242
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17243
		if ( __isExternalAddress(wiconMaskId) ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17244
		    maskBitmap = _HBITMAPVAL( wiconMaskId );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17245
		} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17246
		    if (wiconMaskId != nil) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17247
			PRINTF(("WinWorkstat [warning]: wiconMaskId is not an external address\n"));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17248
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17249
		    maskBitmap = 0;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17250
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17251
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17252
		/*
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17253
		 * if there is no mask, generate one
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17254
		 */
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17255
		if (maskBitmap == 0) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17256
		    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
 17257
		    height = __intVal( wiconHeight );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17258
		    width  = __intVal( wiconWidth  );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17259
		    nBytes = ( width + 15 ) / 8;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17260
		    nBytes = height * nBytes;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17261
		    if (nBytes < sizeof(fastBits)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17262
			ep = fastBits;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17263
		    } else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17264
			ep = allocatedBits = (unsigned char *) malloc(nBytes);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17265
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17266
		    if ( ep == 0 ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17267
			PRINTF(( "WinWorkstat [warning]: malloc failed\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17268
		    } else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17269
			memset(ep, 0, nBytes);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17270
			maskBitmap = CreateBitmap(width, height, 1, 1, ep );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17271
			if ( maskBitmap == NULL ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17272
			    PRINTF(( "WinWorkstat [warning]: mask CREATION failed\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17273
			} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17274
			    privateMask = 1;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17275
			}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17276
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17277
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17278
		if ( maskBitmap != NULL ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17279
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17280
		    iconInfo.fIcon = TRUE;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17281
		    iconInfo.hbmMask  = maskBitmap;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17282
		    iconInfo.hbmColor = xBitMap;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17283
		    xIcon = CreateIconIndirect( &iconInfo );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17284
		    if (privateMask) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17285
			DeleteObject( maskBitmap );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17286
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17287
		} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17288
		    PRINTF(( "WinWorkstat [warning]: no mask for icon !\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17289
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17290
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17291
		if (allocatedBits) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17292
		    free(allocatedBits);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17293
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17294
	    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17295
	} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17296
	    DPRINTF(("WinWorkstat [warning]: xBitMap is zero \n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17297
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17298
    } else {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17299
	if (wiconId != nil) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17300
	    PRINTF(("WinWorkstat [warning]: wiconId is not an external address\n"));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17301
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17302
    }
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17303
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17304
    ZeroMemory(&nid, sizeof(NOTIFYICONDATA));
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17305
    nid.cbSize = sizeof(NOTIFYICONDATA);
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17306
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17307
    if (__isExternalAddress(windowId)) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17308
	HWND hwnd = _HWNDVal(windowId);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17309
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17310
	if (hwnd && IsWindow(hwnd)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17311
	    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
 17312
			     // 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
 17313
	    nid.uFlags =
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17314
		NIF_ICON        //we're adding an icon
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17315
		| 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
 17316
		| NIF_TIP;      //our icon has a tooltip.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17317
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17318
	    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
 17319
	    if (xIcon) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17320
		nid.hIcon   = xIcon;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17321
		/* 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
 17322
	    } else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17323
		nid.hIcon = NULL;        /* THIS MUST BE NULL TO DELETE ICONS */
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17324
	    }
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 17325
	    if (__isStringLike(toolTipMessage)) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17326
		strcpy(nid.szTip, __stringVal(toolTipMessage));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17327
	    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17328
	    Shell_NotifyIcon(NIM_ADD, &nid);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17329
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17330
    }
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17331
%}
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17332
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17333
    "
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17334
     |v icon|
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17335
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17336
     v := StandardSystemView new.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17337
     v openAndWait.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17338
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17339
     icon := Icon stxIcon.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17340
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17341
	  addTrayIconFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17342
	  icon:icon iconMask:nil
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17343
	  toolTipMessage:'Hi There'
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17344
    "
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17345
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17346
    "Created: / 31-10-2007 / 01:51:49 / cg"
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17347
    "Modified: / 05-11-2007 / 12:18:54 / cg"
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17348
!
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17349
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17350
removeTrayIconFor:aView
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17351
    "remove the tray icon"
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17352
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17353
    |windowId wiconId wiconMask invertedWiconMask wiconMaskId
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17354
     wiconWidth wiconHeight|
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17355
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17356
    windowId := aView id.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17357
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17358
%{  /* STACK: 20000 */
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17359
#ifndef WM_TRAY_MESSAGE
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17360
# define WM_TRAY_MESSAGE (WM_USER+0x200)
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17361
#endif
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17362
    NOTIFYICONDATA nid;
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17363
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17364
    ZeroMemory(&nid, sizeof(NOTIFYICONDATA));
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17365
    nid.cbSize = sizeof(NOTIFYICONDATA);
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17366
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17367
    if (__isExternalAddress(windowId)) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17368
	HWND hwnd = _HWNDVal(windowId);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17369
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17370
	if (hwnd && IsWindow(hwnd)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17371
	    nid.hWnd = hwnd;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17372
	    Shell_NotifyIcon(NIM_DELETE, &nid);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17373
	}
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17374
    }
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17375
%}
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17376
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17377
    "
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17378
     |v icon|
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17379
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17380
     v := StandardSystemView new.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17381
     v openAndWait.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17382
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17383
     icon := Icon stxIcon.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17384
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17385
	  addTrayIconFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17386
	  icon:icon iconMask:nil
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17387
	  toolTipMessage:'Hi There'.
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17388
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17389
     Delay waitForSeconds:3.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17390
     icon := Tools::NewSystemBrowser defaultIcon.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17391
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17392
	  setTrayIconFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17393
	  icon:icon iconMask:nil.
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17394
     Delay waitForSeconds:3.
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17395
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17396
	    removeTrayIconFor:v.
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17397
    "
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17398
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17399
    "Created: / 05-11-2007 / 12:17:17 / cg"
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17400
!
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17401
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17402
setTrayIconFor:aView icon:wicon iconMask:wiconMaskArg
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17403
    "change the tray icon"
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17404
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17405
    |windowId wiconId wiconMask invertedWiconMask wiconMaskId
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17406
     wiconWidth wiconHeight|
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17407
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17408
    windowId := aView id.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17409
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17410
    wicon notNil ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17411
	wiconId := (wicon asFormOn:self) id.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17412
	wiconHeight := wicon height.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17413
	wiconWidth  := wicon width.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17414
	wiconMask := wiconMaskArg.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17415
	wiconMask isNil ifTrue:[
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17416
	    wiconMask := wicon mask.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17417
	].
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17418
	wiconMask notNil ifTrue:[
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17419
	    "/ WIN32's mask has zeros for opaque pixels
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17420
	    invertedWiconMask := wiconMask copy.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17421
	    invertedWiconMask bits invert.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17422
	    invertedWiconMask := invertedWiconMask onDevice:self.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17423
	    wiconMaskId := invertedWiconMask id
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17424
	].
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17425
    ].
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17426
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17427
%{  /* STACK: 20000 */
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17428
#ifndef WM_TRAY_MESSAGE
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17429
# define WM_TRAY_MESSAGE (WM_USER+0x200)
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17430
#endif
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17431
    HBITMAP        xBitMap, maskBitmap;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17432
    HICON          xIcon = (HICON)0;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17433
    ICONINFO       iconInfo;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17434
    NOTIFYICONDATA nid;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17435
    unsigned char fastBits[10000];
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17436
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17437
    /* get bitmap for icon */
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17438
    if ( __isExternalAddress(wiconId) ) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17439
	xBitMap = _HBITMAPVAL( wiconId );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17440
	if ( xBitMap != 0 ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17441
	    BITMAP bm;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17442
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17443
	    if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17444
		int d = bm.bmPlanes * bm.bmBitsPixel;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17445
		BYTE *ep;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17446
		int height, width;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17447
		int nBytes;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17448
		unsigned char *allocatedBits = 0;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17449
		int privateMask = 0;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17450
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17451
		if ( __isExternalAddress(wiconMaskId) ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17452
		    maskBitmap = _HBITMAPVAL( wiconMaskId );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17453
		} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17454
		    if (wiconMaskId != nil) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17455
			PRINTF(("WinWorkstat [warning]: wiconMaskId is not an external address\n"));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17456
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17457
		    maskBitmap = 0;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17458
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17459
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17460
		/*
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17461
		 * if there is no mask, generate one
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17462
		 */
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17463
		if (maskBitmap == 0) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17464
		    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
 17465
		    height = __intVal( wiconHeight );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17466
		    width  = __intVal( wiconWidth  );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17467
		    nBytes = ( width + 15 ) / 8;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17468
		    nBytes = height * nBytes;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17469
		    if (nBytes < sizeof(fastBits)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17470
			ep = fastBits;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17471
		    } else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17472
			ep = allocatedBits = (unsigned char *) malloc(nBytes);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17473
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17474
		    if ( ep == 0 ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17475
			PRINTF(( "WinWorkstat [warning]: malloc failed\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17476
		    } else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17477
			memset(ep, 0, nBytes);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17478
			maskBitmap = CreateBitmap(width, height, 1, 1, ep );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17479
			if ( maskBitmap == NULL ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17480
			    PRINTF(( "WinWorkstat [warning]: mask CREATION failed\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17481
			} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17482
			    privateMask = 1;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17483
			}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17484
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17485
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17486
		if ( maskBitmap != NULL ) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17487
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17488
		    iconInfo.fIcon = TRUE;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17489
		    iconInfo.hbmMask  = maskBitmap;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17490
		    iconInfo.hbmColor = xBitMap;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17491
		    xIcon = CreateIconIndirect( &iconInfo );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17492
		    if (privateMask) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17493
			DeleteObject( maskBitmap );
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17494
		    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17495
		} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17496
		    PRINTF(( "WinWorkstat [warning]: no mask for icon !\n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17497
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17498
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17499
		if (allocatedBits) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17500
		    free(allocatedBits);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17501
		}
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17502
	    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17503
	} else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17504
	    DPRINTF(("WinWorkstat [warning]: xBitMap is zero \n" ));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17505
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17506
    } else {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17507
	if (wiconId != nil) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17508
	    PRINTF(("WinWorkstat [warning]: wiconId is not an external address\n"));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17509
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17510
    }
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17511
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17512
    ZeroMemory(&nid, sizeof(NOTIFYICONDATA));
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17513
    nid.cbSize = sizeof(NOTIFYICONDATA);
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17514
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17515
    if (__isExternalAddress(windowId)) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17516
	HWND hwnd = _HWNDVal(windowId);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17517
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17518
	if (hwnd && IsWindow(hwnd)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17519
	    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
 17520
			     // 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
 17521
	    nid.uFlags = NIF_ICON;      //our icon has a tooltip.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17522
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17523
	    if (xIcon) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17524
		nid.hIcon   = xIcon;
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17525
		/* 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
 17526
	    } else {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17527
		nid.hIcon = NULL;        /* THIS MUST BE NULL TO DELETE ICONS */
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17528
	    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17529
	    Shell_NotifyIcon(NIM_MODIFY, &nid);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17530
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17531
    }
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17532
%}
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17533
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17534
    "
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17535
     |v icon|
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17536
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17537
     v := StandardSystemView new.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17538
     v openAndWait.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17539
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17540
     icon := Icon stxIcon.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17541
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17542
	  addTrayIconFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17543
	  icon:icon iconMask:nil
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17544
	  toolTipMessage:'Hi There'.
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17545
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17546
     Delay waitForSeconds:3.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17547
     icon := Tools::NewSystemBrowser defaultIcon.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17548
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17549
	  setTrayIconFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17550
	  icon:icon iconMask:nil.
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17551
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17552
    "
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17553
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17554
    "Created: / 31-10-2007 / 11:41:33 / cg"
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17555
    "Modified: / 05-11-2007 / 12:19:12 / cg"
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17556
!
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17557
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17558
setTrayIconsToolTipMessageFor:aView to:toolTipMessageArg
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17559
    "Change the toolTopText.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17560
     Windows seems to have a bug here, in that while being shown,
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17561
     a change of the toolTipText is not immediately visible
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17562
     (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
 17563
     and reopened)
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17564
     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
 17565
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17566
    |windowId wiconId wiconMask invertedWiconMask wiconMaskId
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17567
     wiconWidth wiconHeight toolTipMessage|
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17568
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17569
    "/ 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
 17570
    toolTipMessageArg size > 63 ifTrue:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17571
	toolTipMessage := toolTipMessageArg copyTo:63
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17572
    ] ifFalse:[
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17573
	toolTipMessage := toolTipMessageArg.
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17574
    ].
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17575
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17576
    windowId := aView id.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17577
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17578
%{  /* STACK: 20000 */
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17579
    NOTIFYICONDATA nid;
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17580
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17581
    ZeroMemory(&nid, sizeof(NOTIFYICONDATA));
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17582
    nid.cbSize = sizeof(NOTIFYICONDATA);
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17583
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17584
    if (__isExternalAddress(windowId)) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17585
	HWND hwnd = _HWNDVal(windowId);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17586
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17587
	if (hwnd && IsWindow(hwnd)) {
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17588
	    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
 17589
			     // 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
 17590
	    nid.uFlags = NIF_TIP;    //change the tooltip.
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 17591
	    if (__isStringLike(toolTipMessage)) {
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17592
		strcpy(nid.szTip, __stringVal(toolTipMessage));
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17593
	    }
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17594
	    Shell_NotifyIcon(NIM_MODIFY, &nid);
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17595
	}
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17596
    }
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17597
%}
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17598
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17599
    "
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17600
     |v icon|
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17601
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17602
     v := StandardSystemView new.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17603
     v openAndWait.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17604
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17605
     icon := Icon stxIcon.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17606
     Screen current
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17607
	  addTrayIconFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17608
	  icon:icon iconMask:nil
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17609
	  toolTipMessage:'Hi There'.
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17610
     1 to:5 do:[:i |
4854
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17611
	 Delay waitForSeconds:2.
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17612
	 Screen current
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17613
	      setTrayIconsToolTipMessageFor:v
72fb81def965 debugging native dialogs
Claus Gittinger <cg@exept.de>
parents: 4839
diff changeset
 17614
	      to:(i printString).
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17615
     ].
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17616
     v destroy.
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17617
    "
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17618
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17619
    "Created: / 31-10-2007 / 11:25:49 / cg"
4839
94d6e856774e comments;
Claus Gittinger <cg@exept.de>
parents: 4832
diff changeset
 17620
    "Modified: / 05-11-2007 / 12:20:53 / cg"
4831
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17621
! !
6e6e9579cae0 icon & toolTip update for tray
Claus Gittinger <cg@exept.de>
parents: 4829
diff changeset
 17622
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17623
!WinWorkstation methodsFor:'window stuff'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17624
4792
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17625
activateWindow1:aWindowId
4523
df48174867cc Do not collapse a maximized window on #activate:
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
 17626
    "make a window active (so that it gets the focus)"
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 17627
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17628
%{  /* NOCONTEXT */
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 17629
    if (__isExternalAddress(aWindowId)) {
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17630
	HWND win = _HWNDVal(aWindowId);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17631
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17632
	if (win) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17633
	    CPRINTF(("activateWindow %x\n",win));
4353
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4351
diff changeset
 17634
#if 0
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17635
	    ShowWindowAsync(win, SW_SHOW);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17636
#else
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17637
	    ShowWindow(win, SW_SHOW);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17638
#endif
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17639
	}
4792
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17640
    }
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17641
%}
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17642
!
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17643
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17644
activateWindow2:aWindowId
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17645
    "make a window active (so that it gets the focus).
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17646
     Paranoid implementation."
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17647
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17648
%{  /* NOCONTEXT */
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17649
    if (__isExternalAddress(aWindowId)) {
4804
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17650
	HWND win = _HWNDVal(aWindowId);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17651
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17652
	if (win) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17653
	    DWORD activeThreadID, activeProcessID;
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17654
	    DWORD myThreadID;
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17655
	    HWND foregroundWindow = GetForegroundWindow();
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17656
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17657
	    if (foregroundWindow) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17658
		activeThreadID = GetWindowThreadProcessId(foregroundWindow, &activeProcessID);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17659
		myThreadID = GetCurrentThreadId();
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17660
		AttachThreadInput(activeThreadID, myThreadID, TRUE);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17661
	    }
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17662
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17663
	    // Do our stuff here ;-)
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17664
	    ShowWindow(win, SW_SHOW);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17665
	    SetForegroundWindow(win);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17666
	    SetFocus(win);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17667
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17668
	    if (foregroundWindow) {
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17669
		AttachThreadInput(activeThreadID, myThreadID, FALSE);
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17670
	    }
8f5c11474e4d font extent computation
Claus Gittinger <cg@exept.de>
parents: 4802
diff changeset
 17671
	}
4792
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17672
    }
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17673
%}
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17674
!
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17675
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17676
activateWindow:aWindowId
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17677
    "make a window active (so that it gets the focus)"
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17678
5150
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17679
    "/ 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
 17680
    "/ we might try activate2 there.
59e34dfdfae7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
 17681
5150
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 17682
    "/ self activateWindow1:aWindowId
6590
fbca4476f22c class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6565
diff changeset
 17683
    self activateWindow2:aWindowId.
2333
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 17684
!
3f55f0f09e25 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2331
diff changeset
 17685
4490
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17686
animateWindow:aWindowId show:doShow animation:animationSymbolorNil time:timeInMillisOrNil
4491
c011e738596f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4490
diff changeset
 17687
    "make a window visible/invisible with animation effect.
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17688
     CAVEAT:
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17689
	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
 17690
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17691
%{
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17692
    if (__isExternalAddress(aWindowId)) {
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17693
	HWND hWnd = _HWNDVal(aWindowId);
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17694
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17695
	if (hWnd) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17696
	    DWORD how = (doShow == true) ? AW_ACTIVATE : AW_HIDE;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17697
	    DWORD time = 0;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17698
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17699
	    CPRINTF(("mapWindowAnimated %x\n", hWnd));
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17700
	    if (animationSymbolorNil != nil) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17701
		if (__isSmallInteger(timeInMillisOrNil)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17702
		    time = __intVal(timeInMillisOrNil);
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17703
		}
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17704
		if (animationSymbolorNil == @symbol(SLIDE)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17705
		    how |= AW_SLIDE;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17706
		} else if (animationSymbolorNil == @symbol(BLEND)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17707
		    how |= AW_BLEND;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17708
		} else if (animationSymbolorNil == @symbol(CENTER)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17709
		    how |= AW_CENTER;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17710
		} else if (animationSymbolorNil == @symbol(HOR_POSITIVE)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17711
		    how |= AW_HOR_POSITIVE;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17712
		} else if (animationSymbolorNil == @symbol(HOR_NEGATIVE)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17713
		    how |= AW_HOR_NEGATIVE;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17714
		} else if (animationSymbolorNil == @symbol(VER_POSITIVE)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17715
		    how |= AW_VER_POSITIVE;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17716
		} else if (animationSymbolorNil == @symbol(VER_NEGATIVE)) {
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17717
		    how |= AW_VER_NEGATIVE;
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17718
		}
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17719
	    }
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17720
	    AnimateWindow(hWnd, time, how);
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17721
	}
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 17722
	RETURN ( self );
4490
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17723
    }
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17724
%}
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17725
!
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 17726
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17727
configureWindow:aWindowId sibling:siblingId stackMode:modeSymbol
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17728
    "configure stacking operation of aWindowId w.r.t siblingId"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17729
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17730
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17731
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17732
dropFilesWindow:aWindowId accept:doAccept
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17733
    "window accept Files from Shell"
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17734
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17735
%{  /*  */
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17736
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17737
    if (__isExternalAddress(aWindowId)) {
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17738
	HWND hWnd = _HWNDVal(aWindowId);
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17739
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17740
	if (hWnd) {
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17741
	    if (doAccept == true)
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17742
	    DragAcceptFiles(hWnd, (doAccept == true) ? TRUE : FALSE);
2374
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17743
	}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17744
	RETURN ( self );
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17745
    }
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17746
%}
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17747
!
0eccb286561b redefined #preferredIconSize
Claus Gittinger <cg@exept.de>
parents: 2369
diff changeset
 17748
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17749
findWindow:lpClassName windowName:lpWindowName
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 17750
    "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
 17751
     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
 17752
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 17753
    ((lpClassName notNil and:[lpClassName isWideString])
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 17754
     or:[lpWindowName notNil and:[lpWindowName isWideString]]) ifTrue:[
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 17755
	^ self
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 17756
	    primFindWindowW:(lpClassName isNil
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 17757
				    ifTrue:[nil]
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 17758
				    ifFalse:[lpClassName asUnicode16StringZ])
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 17759
	    windowName:(lpWindowName isNil
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 17760
				    ifTrue:[nil]
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 17761
				    ifFalse:[lpWindowName asUnicode16StringZ])
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17762
    ].
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17763
    ^ self primFindWindowA:lpClassName windowName:lpWindowName
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17764
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17765
    "
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17766
     |h|
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17767
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17768
     h := Screen current findWindow:'Shell_TrayWnd' windowName:''.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17769
     Screen current prim_getWindowRect:h.
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17770
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17771
     Display findWindow:nil windowName:'ST/X Launcher'
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17772
    "
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17773
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 17774
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17775
getParentWindowIdOfWindowId:aChildWindowId
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17776
%{  /* NOCONTEXT */
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17777
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17778
    if (__isExternalAddress(aChildWindowId)) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17779
	HWND wChild = _HWNDVal(aChildWindowId);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17780
	HWND wParent;
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17781
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17782
	if (wChild) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17783
	    wParent = GetParent(wChild);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17784
	    if (wParent) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17785
		RETURN ( __MKEXTERNALADDRESS(wParent) );
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17786
	    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17787
	}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17788
    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17789
%}.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17790
    ^ nil
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17791
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17792
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17793
     |top v|
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17794
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17795
     top := View new.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17796
     v := View in:top.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17797
     top realize.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17798
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17799
     self assert:(Display getParentWindowIdOfWindowId:(v id)) = top id.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17800
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17801
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17802
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17803
getThreadIdOfWindowId:windowId
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17804
%{  /* NOCONTEXT */
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17805
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17806
    if (__isExternalAddress(windowId)) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17807
	HWND hwnd = _HWNDVal(windowId);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17808
	DWORD id;
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17810
	if (hwnd) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17811
	    id = GetWindowThreadProcessId(hwnd, &id);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17812
	    RETURN ( __MKEXTERNALADDRESS(id) );
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17813
	}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17814
    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17815
%}.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17816
    ^ nil
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17817
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17818
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17819
     |top|
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17820
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17821
     top := View new.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17822
     top realize.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17823
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17824
     self assert:(Display getThreadIdOfWindowId:(top id)) = OperatingSystem getProcessId.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17825
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17826
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17827
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17828
getWindowClassName:aWindowId
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17829
    "get a (possibly alien) window's class name"
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17830
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17831
    |buffer n|
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17832
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17833
    buffer := Unicode16String new:200.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17834
    n := self primGetWindowClassW:aWindowId into:buffer size:200.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17835
    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
 17836
	^ (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
 17837
    ].
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17838
    self primitiveFailed.
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17839
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17840
    "
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17841
     |h|
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17842
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17843
     h := Display findWindow:nil windowName:'ST/X Launcher'.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17844
     Display getWindowClassName:h.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17845
    "
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17846
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17847
    "
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17848
     |h|
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17849
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17850
     h := Display findWindow:nil windowName:'ST/XX Launcher'.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17851
     Display getWindowText:h.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17852
    "
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17853
!
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17854
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17855
getWindowIdFromThreadId:id
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17856
    |l|
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17857
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17858
    l := OrderedCollection new.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17859
    self primEnumWindowsInto:l.
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17860
    l do:[:eachWindowId |
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17861
	(self getParentWindowIdOfWindowId:eachWindowId) isNil ifTrue:[
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17862
	    "/ a topView
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17863
	    (self getThreadIdOfWindowId:eachWindowId) = id ifTrue:[
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17864
		^ eachWindowId
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17865
	    ].
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17866
	]
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17867
    ].
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17868
    ^ nil
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17869
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17870
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17871
     Display getWindowIdFromThreadId:(OperatingSystem getProcessId)
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17872
    "
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17873
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 17874
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17875
getWindowRectangle:aWindowId
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17876
    "get a (possibly alien) window's screen rectangle"
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17877
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17878
    |bytes|
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17879
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17880
    (aWindowId isNil or:[aWindowId address == 0]) ifTrue:[^ self].
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17881
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17882
    bytes := ByteArray new:(ExternalBytes sizeofLong*4).
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17883
    self primGetWindowRect:aWindowId lpRect:bytes.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17884
    ^ Rectangle
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17885
	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
 17886
	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
 17887
	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
 17888
	bottom:(bytes longAt:13)
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17889
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17890
    "
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17891
     |handle|
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17892
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17893
     handle := Display findWindow: nil windowName: 'ST/X Launcher'.
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17894
     (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
 17895
     Display getWindowRectangle:handle.
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17896
    "
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17897
!
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17898
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17899
getWindowText:aWindowId
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17900
    "get a (possibly alien) window's title text"
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17901
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17902
    |buffer n|
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17903
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17904
    buffer := Unicode16String new:200.
5334
da0ae55ea30f code cleanup
Claus Gittinger <cg@exept.de>
parents: 5333
diff changeset
 17905
    n := self primGetWindowTextW:aWindowId into:buffer size:200.
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 17906
    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
 17907
	^ (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
 17908
    ].
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 17909
    self primitiveFailed.
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17910
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17911
    "
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17912
     |h|
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17913
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17914
     h := Display findWindow:nil windowName:'ST/X Launcher'.
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17915
     Display getWindowText:h.
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17916
    "
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17917
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17918
    "
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17919
     |h|
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17920
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17921
     h := Display findWindow:nil windowName:'ST/XX Launcher'.
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17922
     Display getWindowText:h.
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17923
    "
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17924
!
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 17925
4455
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17926
isValidWindowId:aWindowId
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17927
    "return true, if the given window ID is (still) valid.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17928
     Especially useful, if the passed windowID is
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17929
     an alien (external) windows id."
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17930
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 17931
%{  /* NOCONTEXT */
4455
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17932
    if (__isExternalAddress(aWindowId)) {
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17933
	HWND win = _HWNDVal(aWindowId);
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17934
	DWORD threadID, processID = 0;
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17935
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17936
	if (! IsWindow(win)) {
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17937
	    RETURN (false);
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17938
	}
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17939
	threadID = GetWindowThreadProcessId(win, &processID);
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17940
	if ((threadID==0) || (processID==0)) {
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17941
	    RETURN (false);
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17942
	}
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17943
	RETURN (true);
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17944
    }
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17945
%}.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17946
    self primitiveFailed.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17947
    ^ false
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17948
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17949
    "
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17950
     |v aWindowId ok|
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17951
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17952
     v := StandardSystemView new.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17953
     v label:'hello'.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17954
     v openAndWait.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17955
     aWindowId := v id.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17956
     ok := Display isValidWindowId:aWindowId.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17957
     Transcript showCR:'ok is: ' , ok printString.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17958
     Delay waitForSeconds:1.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17959
     v destroy.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17960
     Delay waitForSeconds:0.5.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17961
     ok := Display isValidWindowId:aWindowId.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17962
     Transcript showCR:'ok is: ' , ok printString.
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17963
    "
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17964
!
934b54c11ed4 drop from windows
Claus Gittinger <cg@exept.de>
parents: 4448
diff changeset
 17965
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17966
lowerWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17967
    "bring a window to back"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17968
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17969
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17970
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17971
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17972
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17973
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 17974
	if (win) {
2244
c47cacb08e76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2240
diff changeset
 17975
	    CPRINTF(("lowerWindow %x\n",win));
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 17976
	    SetWindowPos(win, HWND_BOTTOM, 0, 0, 0, 0,
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 17977
			 SWP_NOSENDCHANGING |
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 17978
			 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17979
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17980
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 17981
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 17982
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17983
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 17984
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 17985
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
 17986
    "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
 17987
     in addition, allow change of extend, position, minExtend and maxExtent.
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17988
     Needed for restart, to allow recreating a view as iconified,
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17989
     and to collaps/expand windows."
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17990
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17991
    |minW minH maxW maxH|
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17992
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17993
    minExt notNil ifTrue:[
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17994
	minW := minExt x.
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17995
	minH := minExt y.
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17996
    ].
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 17997
    maxExt notNil ifTrue:[
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17998
	maxW := maxExt x.
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 17999
	maxH := maxExt y.
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18000
    ].
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18001
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18002
%{
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18003
    if (__isExternalAddress(aWindowId)) {
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18004
	HWND win = _HWNDVal(aWindowId);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18005
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18006
	if (win) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18007
	    int bw = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18008
	    int flag = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18009
	    int __left, __top, __width, __height;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18010
	    int winStyleBits;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18011
	    int winExStyleBits;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18012
	    localWindowInfo *lI;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18013
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18014
	    bw = GetWindow_bw(win);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18015
	    winStyleBits = GetWindowLong(win, GWL_STYLE);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18016
	    winExStyleBits = GetWindowLong(win, GWL_EXSTYLE);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18017
	    lI = GETLOCALWINDOWINFOPTR(win);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18018
	    if (! lI) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18019
		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
 18020
		RETURN (self);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18021
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18022
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18023
	    if (__bothSmallInteger(x, y)) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18024
		__left = __intVal(x) + bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18025
		__top = __intVal(y) + bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18026
	    } else {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18027
		__left = __top = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18028
		flag |= SWP_NOMOVE;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18029
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18030
	    if (__bothSmallInteger(w, h)) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18031
		__width = __intVal(w) - bw - bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18032
		__height = __intVal(h) - bw - bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18033
	    } else {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18034
		__width = __height = 100;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18035
		flag |= SWP_NOSIZE;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18036
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18037
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18038
	    if (__bothSmallInteger(minW, minH)) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18039
		RECT rec;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18040
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18041
		rec.left = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18042
		rec.top = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18043
		rec.right = __intVal(minW);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18044
		rec.bottom = __intVal(minH);
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18045
#ifdef ADJUSTWINDOW
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18046
		AdjustWindowRectEx(&rec, winStyleBits, 0, winExStyleBits);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18047
#endif
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18048
		lI->minWidth = rec.right - rec.left;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18049
		lI->minHeight = rec.bottom - rec.top;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18050
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18051
	    if (__bothSmallInteger(maxW, maxH)) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18052
		RECT rec;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18053
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18054
		rec.left = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18055
		rec.top = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18056
		rec.right = __intVal(maxW);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18057
		rec.bottom = __intVal(maxH);
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18058
#ifdef ADJUSTWINDOW
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18059
		AdjustWindowRectEx(&rec, winStyleBits, 0, winExStyleBits);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18060
#endif
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18061
		lI->maxWidth = rec.right - rec.left;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18062
		lI->maxHeight = rec.bottom - rec.top;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18063
	    }
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18064
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18065
#ifdef ADJUSTWINDOW
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18066
	    if (flag != (SWP_NOMOVE | SWP_NOSIZE)) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18067
		RECT rec;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18068
		int __left0, __top0, __width0, __height0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18069
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18070
		__left0   = __left;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18071
		__top0    = __top;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18072
		__width0  = __width;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18073
		__height0 = __height;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18074
5545
24427576c2ac fixed (?) the "debugView-moves"-behavior (remap at slightly shifted position)
Claus Gittinger <cg@exept.de>
parents: 5523
diff changeset
 18075
		rec.left = __left;
24427576c2ac fixed (?) the "debugView-moves"-behavior (remap at slightly shifted position)
Claus Gittinger <cg@exept.de>
parents: 5523
diff changeset
 18076
		// rec.left = __left-2;
24427576c2ac fixed (?) the "debugView-moves"-behavior (remap at slightly shifted position)
Claus Gittinger <cg@exept.de>
parents: 5523
diff changeset
 18077
		rec.top = __top;
24427576c2ac fixed (?) the "debugView-moves"-behavior (remap at slightly shifted position)
Claus Gittinger <cg@exept.de>
parents: 5523
diff changeset
 18078
		// rec.top = __top-2;
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18079
		rec.right = rec.left + __width;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18080
		rec.bottom = rec.top + __height;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18081
		AdjustWindowRectEx(&rec, winStyleBits, 0, winExStyleBits);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18082
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18083
		__left = rec.left;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18084
		__top = rec.top;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18085
		__width = rec.right - rec.left;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18086
		__height = rec.bottom - rec.top;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18087
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18088
		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
 18089
			 win,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18090
			 __left0, __top0, __width0, __height0,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18091
			 __left, __top, __width, __height));
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18092
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18093
#else
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18094
	    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
 18095
		     win,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18096
		     __left, __top, __width, __height));
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18097
#endif
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18098
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18099
	    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
 18100
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18101
	    if (aBoolean == true) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18102
		/* iconified */
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18103
//              SetWindowPos(win, (HWND)0,
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18104
//                           __left, __top, __width, __height,
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18105
//                           flag);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18106
//                ShowWindow(win, SW_SHOWMINIMIZED);
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18107
		ShowWindowAsync(win, SW_SHOWMINNOACTIVE);
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
 18108
/*
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18109
		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
 18110
*/
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18111
	    } else {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18112
		/* normal */
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18113
		SetWindowPos(win, (HWND)0,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18114
			     __left, __top, __width, __height,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18115
			     flag);
2681
b86cc145f329 threadsafe printfs now defined in ntIntern.h
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
 18116
/*
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18117
		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
 18118
*/
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18119
		//ShowWindow(win, SW_RESTORE);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18120
		// ShowWindowAsync(win, SW_RESTORE);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18121
		ShowWindowAsync(win, SW_SHOWNOACTIVATE);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18122
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18123
	}
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18124
	RETURN ( self );
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18125
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18126
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18127
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18128
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18129
mapWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18130
    "make a window visible"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18131
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18132
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18133
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18134
    if (__isExternalAddress(aWindowId)) {
2724
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 18135
	HWND hWnd = _HWNDVal(aWindowId);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 18136
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 18137
	if (hWnd) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 18138
	    CPRINTF(("mapWindow %x\n", hWnd));
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 18139
	    if (GetParent(hWnd) == 0) {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 18140
		ShowWindowAsync(hWnd, SW_SHOWNOACTIVATE);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 18141
	    } else {
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 18142
		ShowWindowAsync(hWnd, SW_SHOWNORMAL);
a8d2a8723791 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2715
diff changeset
 18143
	    }
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18144
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18145
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18146
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18147
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18148
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18149
4490
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 18150
mapWindow:aWindowId animation:animationSymbolorNil time:timeInMillisOrNil
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 18151
    "make a window visible with some animation effect"
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 18152
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 18153
    self animateWindow:aWindowId show:true animation:animationSymbolorNil time:timeInMillisOrNil
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 18154
!
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 18155
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18156
moveResizeWindow:aWindowId x:x y:y width:w height:h
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18157
    "move and resize a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18158
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18159
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18160
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18161
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18162
     && __bothSmallInteger(x, y)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18163
     && __bothSmallInteger(w, h)) {
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18164
	HWND win = _HWNDVal(aWindowId);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18165
	int bw = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18166
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18167
	if (win) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18168
	    bw = GetWindow_bw(win);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18169
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18170
	    rec.left = __intVal(x) + bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18171
	    rec.top = __intVal(y) + bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18172
	    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
 18173
	    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
 18174
	    if (GetParent(win) == 0) {
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18175
#ifdef ADJUSTWINDOW
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18176
		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
 18177
#endif
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18178
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18179
	    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
 18180
			 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
 18181
	    SetWindowPos(win, (HWND)0,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18182
			 rec.left, rec.top,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18183
			 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
 18184
			 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
 18185
	}
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18186
	RETURN ( self );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18187
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18188
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18189
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18190
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18191
moveWindow:aWindowId x:x y:y
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18192
    "move a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18193
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18194
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18195
    RECT rec;
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18196
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18197
    if (__isExternalAddress(aWindowId)
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18198
     && __bothSmallInteger(x, y)) {
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18199
	HWND win = _HWNDVal(aWindowId);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18200
	int bw = 0;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18201
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18202
	if (win) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18203
	    bw = GetWindow_bw(win);
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18204
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18205
	    rec.left = __intVal(x) + bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18206
	    rec.top = __intVal(y) + bw;
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18207
	    if (GetParent(win) == 0) {
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18208
		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
 18209
		rec.bottom = rec.top + 10;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18210
#ifdef ADJUSTWINDOW
4939
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18211
		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
 18212
#endif
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18213
	    }
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18214
	    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
 18215
			__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
 18216
	    SetWindowPos(win, (HWND)0,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18217
			 rec.left, rec.top,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18218
			 0, 0,
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18219
			 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
 18220
	}
8f9071993f39 workstation: care for pen when drawing text.
Claus Gittinger <cg@exept.de>
parents: 4917
diff changeset
 18221
	RETURN ( self );
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18222
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18223
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18224
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18225
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18226
primEnumChildWindowsOf:aWindowId into:handleList
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18227
%{
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18228
    if (__isExternalAddress(aWindowId)) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 18229
	HWND hwParent = _HWNDVal(aWindowId);
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 18230
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 18231
	if ( EnumChildWindows( hwParent, EnumWindowsProc, (INT)&(handleList))) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 18232
	    DPRINTF(("EnumChildWindows successful\n"));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 18233
	}
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18234
    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18235
%}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18236
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18237
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 18238
primEnumWindowsInto:handleList
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18239
%{
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 18240
    if ( EnumWindows( EnumWindowsProc, (INT)&(handleList))) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 18241
	DPRINTF(("EnumWindows successful\n"));
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 18242
    }
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 18243
%}
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 18244
!
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 18245
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18246
primEnumWindowsOf:threadId into:handleList
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18247
%{
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18248
    if (__isSmallInteger(threadId)) {
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 18249
	if ( EnumThreadWindows( __intVal(threadId), EnumWindowsProc, (INT)&(handleList))) {
5596
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 18250
	    DPRINTF(("EnumThreadWindows successful\n"));
e3213346f4c2 test for focus after double-click
Claus Gittinger <cg@exept.de>
parents: 5589
diff changeset
 18251
	}
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18252
    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18253
%}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18254
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18255
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 18256
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
 18257
    "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
 18258
     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
 18259
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18260
    <apicall: handle "FindWindowA" (lpstr lpstr) module: "user32.dll" >
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18261
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 18262
    "
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18263
     Display primFindWindowA: nil windowName: 'ST/X Launcher'
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 18264
    "
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 18265
!
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 18266
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 18267
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
 18268
    "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
 18269
     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
 18270
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18271
    <apicall: handle "FindWindowW" (pointer pointer) module: "user32.dll" >
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18272
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18273
    "
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 18274
     Display primFindWindowW: nil windowName: 'ST/X Launcher' asUnicode16String
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18275
    "
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18276
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18277
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 18278
primGetWindowClassW:aWindowId into:buffer size:maxSize
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 18279
    "get a window's class name"
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 18280
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 18281
    <apicall: int "GetClassNameW" (handle, pointer, int) module: "user32.dll" >
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 18282
!
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 18283
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18284
primGetWindowRect:aWindowId lpRect:lpRect
5335
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 18285
    "get a window's screen rectangle"
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 18286
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 18287
    <apicall: int "GetWindowRect" (handle, pointer) module: "user32.dll" >
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 18288
!
344723f3f065 +getWindowRect
Claus Gittinger <cg@exept.de>
parents: 5334
diff changeset
 18289
5334
da0ae55ea30f code cleanup
Claus Gittinger <cg@exept.de>
parents: 5333
diff changeset
 18290
primGetWindowTextW:aWindowId into:buffer size:maxSize
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18291
    "get a window's title text"
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18292
5333
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 18293
    <apicall: int "GetWindowTextW" (handle, pointer, int) module: "user32.dll" >
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 18294
!
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 18295
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 18296
primSendMessage:aWindowId message:message wParam:wParam lParam:lParam
7328354388f0 code cleanup
Claus Gittinger <cg@exept.de>
parents: 5332
diff changeset
 18297
    "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
 18298
     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
 18299
     does not return until the target's window procedure has processed the message."
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18300
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18301
    <apicall: bool "SendMessageA" (handle uint pointer pointer) module: "user32.dll" >
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18302
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18303
5027
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 18304
primSetForegroundWindow: aWindowId
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 18305
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 18306
    "
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 18307
    If the window was brought to the foreground, the return value is nonzero.
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 18308
    If the window was not brought to the foreground, the return value is zero.
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 18309
    "
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 18310
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 18311
    <apicall: bool "SetForegroundWindow" (handle) module: "user32.dll" >
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 18312
!
683b8654825e added: #primSetForegroundWindow:
fm
parents: 5025
diff changeset
 18313
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18314
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
 18315
%{
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18316
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18317
    HBITMAP        xBitMap, maskBitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18318
    ICONINFO       iconInfo;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18319
    int            height, width;
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18320
    HICON          xIcon = (HICON)0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18321
    unsigned char  fastBits[10000];
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18322
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18323
    DPRINTF(("primSetWindowIconId\n"));
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18324
    if (__isExternalAddress(aWindowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18325
     && __isExternalAddress(wiconId)
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18326
     && __bothSmallInteger(wiconWidth, wiconHeight)) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18327
	HWND win = _HWNDVal(aWindowId);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18328
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18329
	xBitMap = _HBITMAPVAL( wiconId );
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18330
	if ( xBitMap != 0 ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18331
	    BITMAP bm;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18332
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18333
	    if (GetObject(xBitMap, sizeof(bm), (LPSTR)&bm)) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18334
		BYTE *ep;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18335
		int privateMask = 0;
2670
fa11fa15988c event sending partially moved to DevWorkstat;
Claus Gittinger <cg@exept.de>
parents: 2668
diff changeset
 18336
		unsigned char  *allocatedBits = 0;
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18337
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18338
		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
 18339
		height = __intVal( wiconHeight );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18340
		width  = __intVal( wiconWidth  );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18341
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18342
		if ( __isExternalAddress(wmaskId) ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18343
		    maskBitmap = _HBITMAPVAL( wmaskId );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18344
		} else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18345
		    if (wmaskId != nil) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18346
			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
 18347
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18348
		    maskBitmap = 0;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18349
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18350
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18351
		/*
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18352
		 * if there is no mask, generate one
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18353
		 */
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18354
		if (maskBitmap == 0) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18355
		    int nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18356
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18357
		    nBytes = ( width + 31 ) / 8;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18358
		    nBytes = height * nBytes;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18359
		    if (nBytes < sizeof(fastBits)) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18360
			ep = fastBits;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18361
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18362
			ep = allocatedBits = (unsigned char *) malloc(nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18363
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18364
		    if ( ep == 0 ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18365
			PRINTF(( "WinWorkstat [warning]: malloc failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18366
		    } else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18367
			memset(ep, 0, nBytes);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18368
			maskBitmap = CreateBitmap(width, height, 1, 1, ep );
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18369
			if ( maskBitmap == NULL ) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18370
			    PRINTF(( "WinWorkstat [warning]: mask CREATION failed\n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18371
			} else {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18372
			    privateMask = 1;
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18373
			}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18374
		    }
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18375
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18376
		if ( maskBitmap != NULL ) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18377
		    DPRINTF(( "BITMAP mask CREATED!!!\n" ));
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18378
		    iconInfo.fIcon = TRUE;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18379
		    iconInfo.hbmMask  =maskBitmap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18380
		    iconInfo.hbmColor = xBitMap;
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18381
		    xIcon = CreateIconIndirect( &iconInfo );
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18382
		    DPRINTF(( "ICON CREATED!!!\n" ));
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18383
		    if (privateMask) {
2624
cb390689e97f cache last brush
Claus Gittinger <cg@exept.de>
parents: 2623
diff changeset
 18384
			_DeleteObject( maskBitmap, __LINE__ );
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18385
		    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18386
		} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18387
		    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
 18388
		}
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18389
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18390
		if (allocatedBits) {
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18391
		    free(allocatedBits);
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18392
		}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18393
	    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18394
	} else {
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18395
	    DPRINTF(("WinWorkstat [warning]: xBitMap is zero \n" ));
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18396
	}
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18397
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18398
	if (xIcon) {
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
 18399
#ifndef TOPWINDOWCLASS
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18400
	    HICON oldIcon = (HICON)0;
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18401
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 18402
# ifdef _WIN64
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 18403
	    oldIcon = (HICON) GetClassLongPtr(win, GCLP_HICON);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 18404
	    SetClassLongPtr(win, GCLP_HICON, (INT)xIcon);
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 18405
# else
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18406
	    oldIcon = (HICON) GetClassLong(win, GCL_HICON);
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18407
	    SetClassLong(win, GCL_HICON, (DWORD)xIcon);
5988
cb0ef88684f9 64bit changes
Claus Gittinger <cg@exept.de>
parents: 5964
diff changeset
 18408
# endif
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 18409
/* It has to be checked whether this can be deleted!!!!! */
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18410
	    if ( oldIcon ) {
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18411
		if (DestroyIcon( oldIcon )) {
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18412
		    DPRINTF(( "Old icon deleted\n" ));
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18413
		} else {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 18414
		    console_fprintf(stderr, "failed to delete old icon\n");
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18415
		}
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18416
	    }
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
 18417
#else
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 18418
	    SendMessage(win, WM_SETICON, (WPARAM)ICON_SMALL, (LPARAM)xIcon);
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 18419
	    SendMessage(win, WM_SETICON, (WPARAM)ICON_BIG, (LPARAM)xIcon);
2260
954c7dce96aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2253
diff changeset
 18420
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18421
	}
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18422
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18423
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18424
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18425
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18426
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18427
raiseWindow:aWindowId
4523
df48174867cc Do not collapse a maximized window on #activate:
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
 18428
    "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
 18429
     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
 18430
     as topmost, when it gets the focus)"
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18431
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18432
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18433
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18434
    if (__isExternalAddress(aWindowId)) {
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18435
	HWND hWnd = _HWNDVal(aWindowId);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18436
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18437
	if (hWnd) {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18438
	    CPRINTF(("raiseWindow %x\n",hWnd));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18439
	    SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18440
			 /* SWP_NOOWNERZORDER |*/
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18441
			SWP_NOSENDCHANGING | SWP_NOACTIVATE |
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18442
			SWP_NOMOVE | SWP_NOSIZE);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18443
	}
5150
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 18444
    }
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 18445
%}
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 18446
!
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 18447
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 18448
raiseWindowToTop:aWindowId
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 18449
    "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
 18450
     Q: is this a windows-specific thing ?"
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 18451
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 18452
%{  /* NOCONTEXT */
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 18453
577084e6f257 +raiseToTop
Claus Gittinger <cg@exept.de>
parents: 5141
diff changeset
 18454
    if (__isExternalAddress(aWindowId)) {
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18455
	HWND hWnd = _HWNDVal(aWindowId);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18456
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18457
	if (hWnd) {
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18458
	    CPRINTF(("raiseWindow %x\n",hWnd));
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18459
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18460
	    SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18461
			 /* SWP_NOOWNERZORDER |*/
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18462
			SWP_NOSENDCHANGING | SWP_NOACTIVATE |
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18463
			SWP_NOMOVE | SWP_NOSIZE);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18464
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18465
	    SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18466
			 /* SWP_NOOWNERZORDER |*/
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18467
			SWP_NOSENDCHANGING | SWP_NOACTIVATE |
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18468
			SWP_NOMOVE | SWP_NOSIZE);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18469
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18470
	    SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18471
			/* SWP_NOOWNERZORDER | */
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18472
			/* SWP_NOSENDCHANGING | SWP_NOACTIVATE | */
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18473
			SWP_NOMOVE | SWP_NOSIZE);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18474
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18475
	    SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0,
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18476
			/* SWP_NOOWNERZORDER | */
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18477
			/* SWP_NOSENDCHANGING | SWP_NOACTIVATE | */
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18478
			SWP_NOMOVE | SWP_NOSIZE);
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18479
	}
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18480
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18481
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18482
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18483
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18484
raiseWindowToTopMost:aWindowId
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18485
    "bring a window to the very front - above all others (even above non-st/x windows).
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18486
     Q: is this a windows-specific thing ?"
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18487
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18488
%{  /* NOCONTEXT */
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18489
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18490
    if (__isExternalAddress(aWindowId)) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18491
	HWND hWnd = _HWNDVal(aWindowId);
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18492
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18493
	if (hWnd) {
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18494
	    CPRINTF(("raiseWindow %x\n",hWnd));
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18495
	    SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18496
	}
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18497
    }
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18498
%}
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18499
!
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 18500
4441
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18501
reparentWindow:windowId to:newParentWindowId
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18502
    "change a windows parent (an optional interface)"
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18503
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 18504
%{  /* NOCONTEXT */
4441
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18505
    if (__isExternalAddress(windowId)
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18506
     && __isExternalAddress(newParentWindowId)) {
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18507
	HWND hWnd = _HWNDVal(windowId);
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18508
	HWND hWndNewParent = _HWNDVal(newParentWindowId);
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18509
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18510
	SetParent(hWnd, hWndNewParent);
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18511
	RETURN ( true );
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18512
    }
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18513
%}.
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18514
    self primitiveFailed
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18515
!
ebc4b95dd556 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4440
diff changeset
 18516
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18517
resizeWindow:aWindowId width:w height:h
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18518
    "resize a window"
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18519
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18520
%{  /* NOCONTEXT */
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18521
    RECT rec;
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18522
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18523
    if (__isExternalAddress(aWindowId)
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18524
     && __bothSmallInteger(w, h)) {
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18525
	HWND hWnd = _HWNDVal(aWindowId);
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18526
	int bw;
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18527
2593
1d2dad16f32c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2554
diff changeset
 18528
	if (hWnd) {
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18529
	    bw = GetWindow_bw(hWnd);
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18530
2715
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 18531
	    rec.left = 0;  /* only needed to have a valid origin in adjust */
cecc5c10f80e implemented getPixel
Claus Gittinger <cg@exept.de>
parents: 2711
diff changeset
 18532
	    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
 18533
	    rec.right = __intVal(w) - bw - bw;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18534
	    rec.bottom = __intVal(h) - bw - bw;
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18535
#ifdef ADJUSTWINDOW
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18536
	    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
 18537
#endif
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18538
	    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
 18539
	    SetWindowPos(hWnd, (HWND)0,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18540
			 0, 0,
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18541
			 rec.right - rec.left, rec.bottom - rec.top,
5184
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18542
			 SWP_NOSENDCHANGING | SWP_NOACTIVATE |
f53ace9dc9cb pixelSize stuff
Claus Gittinger <cg@exept.de>
parents: 5175
diff changeset
 18543
			 SWP_NOMOVE | SWP_NOZORDER | SWP_NOOWNERZORDER);
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18544
	}
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18545
	RETURN ( self );
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18546
    }
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18547
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18548
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18549
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18550
sendButtonMessageType:messageType at:aPoint toWindowId:aWindowId
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18551
    "send a button message to a window by id (handle)"
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18552
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18553
    |wParam lParam result|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18554
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18555
    (aWindowId isNil or:[aWindowId address == 0]) ifTrue:[^ self].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18556
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18557
    wParam := 0.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18558
    lParam := (aPoint x) + (aPoint y bitShift:16).
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18559
    result := self primSendMessage:aWindowId message:messageType wParam:wParam lParam:lParam.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18560
    ^ result
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18561
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18562
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18563
     |v b externalAddress handle|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18564
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18565
     v := StandardSystemView new.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18566
     b := Button in:v.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18567
     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
 18568
     v openAndWait.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18569
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18570
     handle := b id.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18571
     (handle isNil or:[handle address == 0]) ifTrue:[self halt.].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18572
     externalAddress := handle asExternalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18573
     Display sendButtonPress:1 at:1@1 toWindowId: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18574
     Display sendButtonRelease:1 at:10@10 toWindowId: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18575
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18576
!
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18577
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18578
sendButtonPress:button at:aPoint toWindowId:aWindowId
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18579
    "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
 18580
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18581
    |messageType|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18582
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18583
    self assert:(button between:1 and:3).
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18584
    messageType := #(   16r0201 "WM_LBUTTONDOWN"
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 18585
			16r0207 "WM_MBUTTONDOWN"
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 18586
			16r0204 "WM_RBUTTONDOWN"  ) at:button.
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18587
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18588
    self sendButtonMessageType:messageType at:aPoint toWindowId:aWindowId
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18589
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18590
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18591
     |v b externalAddress handle|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18592
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18593
     v := StandardSystemView new.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18594
     b := Button in:v.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18595
     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
 18596
     v openAndWait.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18597
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18598
     handle := b id.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18599
     (handle isNil or:[handle address == 0]) ifTrue:[self halt.].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18600
     externalAddress := handle asExternalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18601
     Display sendButtonPress:1 at:1@1 toWindowId: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18602
     Display sendButtonRelease:1 at:10@10 toWindowId: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18603
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18604
!
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18605
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18606
sendButtonRelease:button at:aPoint toWindowId:aWindowId
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18607
    "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
 18608
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18609
    |messageType|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18610
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18611
    self assert:(button between:1 and:3).
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 18612
    messageType := #(   16r0202 "WM_LBUTTONUP"
5523
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 18613
			16r0208 "WM_MBUTTONUP"
Stefan Vogel <sv@exept.de>
parents: 5522
diff changeset
 18614
			16r0205 "WM_RBUTTONUP"  ) at:button.
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18615
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18616
    self sendButtonMessageType:messageType at:aPoint toWindowId:aWindowId
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18617
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18618
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18619
     |v b externalAddress handle|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18620
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18621
     v := StandardSystemView new.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18622
     b := Button in:v.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18623
     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
 18624
     v openAndWait.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18625
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18626
     handle := b id.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18627
     (handle isNil or:[handle address == 0]) ifTrue:[self halt.].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18628
     externalAddress := handle asExternalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18629
     Display sendButtonPress:1 at:1@1 toWindowId: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18630
     Display sendButtonRelease:1 at:10@10 toWindowId: externalAddress.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18631
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18632
!
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18633
7601
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18634
sendCopyData: aByteArrayOrString toWindowId: aWindowId
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18635
    "send copy-paste data to a window by id (handle)"
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18636
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18637
    |externalBytes messageType lParam copyDataStruct|
5024
a8d67b2b17b4 add #sendCopyData: toWindowId:
fm
parents: 5023
diff changeset
 18638
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18639
    (aWindowId isNil or:[aWindowId address == 0]) ifTrue:[^ self].
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18640
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18641
    messageType := 74 "WM_COPYDATA".
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18642
7601
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18643
    externalBytes := aByteArrayOrString asExternalBytesUnprotected.
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18644
    copyDataStruct := CopyDataStructStructure new.
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 18645
    copyDataStruct
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 18646
	cbData:externalBytes size;
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 18647
	lpData:externalBytes address.
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18648
    lParam := copyDataStruct asExternalBytesUnprotected.
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18649
    ^ self primSendMessage:aWindowId message:messageType wParam:nil lParam:lParam.
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18650
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18651
    "
7601
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18652
     |handle|
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18653
     handle := Display primFindWindowA: nil windowName: 'expecco'.
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18654
     (handle isNil or:[handle address == 0]) ifTrue:[self halt.].
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18655
     Display sendCopyData: 'openPath: bla' toWindowId: handle.
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18656
     Display setForegroundWindow: handle.
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18657
    "
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18658
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18659
    "
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18660
     |bytes handle|
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18661
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18662
     bytes := 'c:\pipo.net' asByteArray.
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 18663
     handle := Display primFindWindowA: nil windowName: 'ST/X Launcher'.
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 18664
     (handle isNil or:[handle address == 0]) ifTrue:[self halt.].
7601
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18665
     Display setForegroundWindow: handle.
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18666
     Display sendCopyData: bytes toWindowId: handle.
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18667
    "
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18668
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 18669
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18670
setBackingStore:how in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18671
    "turn on/off backing-store for a window"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18672
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18673
    "/ 'WinWorkstation [info]: setBackingStore:in: not yet implemented' infoPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18674
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18675
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18676
setBitGravity:how in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18677
    "set bit gravity for a window"
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18678
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18679
    "/ 'WinWorkstation [info]: setBitGravity:in: not yet implemented' infoPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18680
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18681
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18682
setCursor:aCursorId in:aWindowId
5515
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18683
    "define a cursor for a window"
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18684
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18685
%{  /* NOCONTEXT */
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18686
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18687
    HCURSOR newCursor;
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18688
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18689
    if (ISCONNECTED
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18690
     && __isExternalAddress(aWindowId)
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18691
     && __isExternalAddress(aCursorId)) {
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18692
	HWND win = _HWNDVal(aWindowId);
5521
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18693
//        POINT p;
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18694
//        GUITHREADINFO info;
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18695
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18696
	SetWindow_Cursor(win, _HCURSORVal(aCursorId));
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18697
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18698
	/*
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18699
	 * The window's cursor has been set. When the mouse moves into
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18700
	 * the window, the new cursor will be shown when the WM_SETCURSOR event is handled.
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18701
	 * If the window contains the mouse pointer, or the window has captured the mousem
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18702
	 * no WM_SETCURSOR event is generated, so we have to set the cursor here.
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18703
	 */
5521
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18704
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18705
// forget about the GetGUIThreadInfo stuff (although it works) - __currentPointerView is easier
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18706
//        info.cbSize = sizeof(info);
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18707
//        if (GetGUIThreadInfo(0, &info) == 0) {
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18708
//            info.hwndCapture = 0;               // set to defined value on failure
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18709
//        }
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18710
//        if (info.hwndCapture == win
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18711
//            || (GetCursorPos(&p), WindowFromPoint(p) == win)) {
61222c4d2db8 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5517
diff changeset
 18712
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18713
	if (win == __currentPointerView) {
5515
6a8aafa6f151 changed: #setCursor:in:
Stefan Vogel <sv@exept.de>
parents: 5485
diff changeset
 18714
#if defined(SET_CURSOR_IN_WINTHREAD)
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 18715
	    PostMessage(win, WM_THREAD_SETCURSOR, (WPARAM)0, (INT)_HCURSORVal(aCursorId));
5522
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18716
#else
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18717
	    SetCursor(_HCURSORVal(aCursorId));
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18718
#endif
d95d5f471eca Win95/98/ME is no longer supported - remove code fragments
Stefan Vogel <sv@exept.de>
parents: 5521
diff changeset
 18719
	}
1416
85b4e23ecd86 davids bitmap & font changes
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
 18720
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18721
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18722
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18723
4439
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18724
setForegroundWindow2:aWindowId
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18725
    "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
 18726
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18727
%{  /* NOCONTEXT */
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18728
    if (__isExternalAddress(aWindowId)) {
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18729
	HWND win = _HWNDVal(aWindowId);
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18730
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18731
	if (win) {
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18732
	    ShowWindow(win, SW_SHOW);
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18733
	    SetForegroundWindow(win);
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18734
	    BringWindowToTop(win);
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18735
	}
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18736
	RETURN ( self );
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18737
    }
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18738
%}
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18739
!
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18740
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18741
setForegroundWindow:aWindowId
4523
df48174867cc Do not collapse a maximized window on #activate:
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
 18742
    "make a window the foreground window.
df48174867cc Do not collapse a maximized window on #activate:
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
 18743
     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
 18744
     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
 18745
     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
 18746
7601
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 18747
    <apicall: bool "SetForegroundWindow" (handle) module: "user32.dll" >
4439
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18748
!
19f6cd6c7804 yield when dispatching, to allow for other displays to
Claus Gittinger <cg@exept.de>
parents: 4405
diff changeset
 18749
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18750
setIconName:aString in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18751
    "define a windows iconname"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18752
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18753
%{  /* NOCONTEXT */
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 18754
#if 0
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18755
    if (__isExternalAddress(aWindowId)
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 18756
     && (__isStringLike(aString))) {
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18757
	HWND win = _HWNDVal(aWindowId);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18758
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18759
	SetWindowText(win, __stringVal(aString));
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18760
	RETURN (self);
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 18761
    }
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 18762
#endif
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18763
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18764
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18765
3809
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18766
setParentWindowIdOf:aChildWindowId to:newParentWindowId
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18767
%{  /* NOCONTEXT */
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18768
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18769
    if (__isExternalAddress(aChildWindowId)
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18770
     && __isExternalAddress(newParentWindowId)) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18771
	HWND wChild = _HWNDVal(aChildWindowId);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18772
	HWND wNewParent = _HWNDVal(newParentWindowId);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18773
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18774
	if (wChild && wNewParent) {
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18775
	    SetParent(wChild, wNewParent);
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18776
	}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18777
    }
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18778
%}
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18779
!
8d6f3606ce2e preps to access alien views
penk
parents: 3741
diff changeset
 18780
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18781
setSaveUnder:yesOrNo in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18782
    "turn on/off save-under for a window"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18783
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18784
%{  /* NOCONTEXT */
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18785
    if (yesOrNo != false) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18786
	DPRINTF(("WinWorkstation [info]: setSaveUnder:in: not (yet) implemented\n"));
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18787
    }
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18788
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18789
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18790
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18791
setTransient:aWindowId for:aMainWindowId
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18792
    "set aWindowId to be a transient of aMainWindow.
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18793
     This will make the transient window to be iconified/deiconified
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18794
     together with the mainWindow.
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18795
     Typically, this is set for modal dialogs."
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18796
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18797
%{  /* NOCONTEXT */
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18798
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18799
#ifdef NOT_YET_SUPPORTED
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18800
    if (__isExternalAddress(aWindowId)) {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18801
	HWND w;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18802
	HWND cw = _HWNDVal(aWindowId);
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18803
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18804
	if ((aMainWindowId == nil) || (aMainWindowId == __MKSMALLINT(0))) {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18805
	    w = (HWND) 0;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18806
	} else {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18807
	    if (__isExternalAddress(aMainWindowId)) {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18808
		w = _HWNDVal(aMainWindowId);
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18809
	    } else {
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18810
		goto getOutOfHere;
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18811
	    }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18812
	}
2417
1e40a40e56e0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2416
diff changeset
 18813
	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
 18814
	//SetParent(cw, w);
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18815
	RETURN ( self );
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18816
    }
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18817
 getOutOfHere: ;
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18818
#else
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18819
    RETURN (self);
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18820
#endif
2368
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18821
%}.
a7bd567cd899 md's fixes, drag&drop and clipBoard stuff.
Claus Gittinger <cg@exept.de>
parents: 2364
diff changeset
 18822
    self primitiveFailed
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18823
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18824
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18825
setWindowBackground:aColorIndex in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18826
    "set the windows background color. This is the color with which
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18827
     the view is filled whenever exposed. Do not confuse this with
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18828
     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
 18829
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18830
%{  /* NOCONTEXT */
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18831
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18832
    if (__isExternalAddress(aWindowId)
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18833
     && (__isSmallInteger(aColorIndex))) {
2151
d771faffbc1d md's changes
Claus Gittinger <cg@exept.de>
parents: 2104
diff changeset
 18834
	HWND hWnd = _HWNDVal(aWindowId);
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
 18835
	int clr;
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18836
	HBRUSH oldBrush;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18837
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 18838
	oldBrush = GetWindow_viewBgBrush(hWnd);
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 18839
	if (oldBrush) {
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18840
	    SetWindow_viewBgBrush(hWnd, 0);
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18841
	    _DeleteBrushIfNotInCache(oldBrush, __LINE__);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18842
	}
2633
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
 18843
	clr = st2RGB(__intVal(aColorIndex), 0);
35a113086b6f better view-bg-brush cashing
Claus Gittinger <cg@exept.de>
parents: 2632
diff changeset
 18844
	SetWindow_viewBgColor(hWnd, clr);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18845
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18846
	RETURN (self);
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18847
    }
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 18848
%}
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18849
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18850
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18851
setWindowBackgroundPixmap:aPixmapId in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18852
    "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
 18853
     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
 18854
     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
 18855
     with opaque drawing.
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18856
     NOTICE: due to the limitations of WIN95,
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18857
	     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
 18858
	     are handled by smalltalk code in the WIN95 version."
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18859
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18860
%{
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18861
    if (__isExternalAddress(aWindowId)) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18862
	HWND hWnd = _HWNDVal(aWindowId);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18863
	HBITMAP pixmap;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18864
	HBRUSH oldBrush, newBrush;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18865
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18866
	if (__isExternalAddress(aPixmapId))
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18867
	    pixmap = _HBITMAPVAL(aPixmapId);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18868
	else
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18869
	    pixmap = 0;
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18870
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 18871
	oldBrush = GetWindow_viewBgBrush(hWnd);
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 18872
	if (oldBrush) {
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18873
	    SetWindow_viewBgBrush(hWnd, 0);
2667
f35e2d76acc3 brush cache
Claus Gittinger <cg@exept.de>
parents: 2666
diff changeset
 18874
	    _DeleteBrushIfNotInCache(oldBrush, __LINE__);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18875
	}
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18876
	if (pixmap) {
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18877
	    newBrush = CreatePatternBrush(pixmap);
2659
c181846c6f5a setPixel,
Claus Gittinger <cg@exept.de>
parents: 2653
diff changeset
 18878
	    SetWindow_viewBgBrush(hWnd, newBrush);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18879
/*
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 18880
 *            SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);
2639
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18881
 */
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18882
	}
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18883
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18884
	RETURN (self);
8b2deda94ef3 support for view-bg-pixmaps
Claus Gittinger <cg@exept.de>
parents: 2633
diff changeset
 18885
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18886
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18887
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18888
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18889
setWindowBorderColor:aColorIndex in:aWindowId
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18890
    "set the windows border color.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18891
     NOTICE: borders are not supported by the win32 version."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18892
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18893
%{  /* NOCONTEXT */
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18894
    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
 18895
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18896
    if (__isExternalAddress(aWindowId)
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18897
     && __isSmallInteger(aColorIndex)) {
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18898
	HWND win = _HWNDVal(aWindowId);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18899
	int clr;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18900
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18901
	if (GetParent(win) != 0) {
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18902
	    clr = st2RGB(__intVal(aColorIndex), 0);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18903
	    SetWindow_bdColor(win, clr);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18904
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18905
	    {
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18906
		/*
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18907
		 * 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
 18908
		 * border colors ... (see UIPainter code)
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18909
		 */
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18910
		RECT rect;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18911
		HRGN rgn;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18912
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18913
		GetWindowRect(win, &rect);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18914
		rgn = CreateRectRgn(rect.left, rect.top, rect.right, rect.bottom);
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 18915
		DefWindowProcW(win, WM_NCPAINT, (WPARAM)rgn, 0);
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18916
		_DeleteObject(rgn, __LINE__);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18917
	    }
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18918
	}
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18919
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18920
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18921
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18922
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18923
setWindowBorderPixmap:aPixmapId in:aWindowId
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18924
    "set the windows border pattern.
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18925
     NOTICE: border pixmaps are not supported by the win32 version."
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18926
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18927
%{  /* NOCONTEXT */
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18928
    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
 18929
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18930
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18931
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18932
setWindowBorderWidth:aNumber in:aWindowId
5997
5b46d454a2cb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5988
diff changeset
 18933
    "set a window's border width.
2617
d16f608fa54a tuning & code cleanup
Claus Gittinger <cg@exept.de>
parents: 2614
diff changeset
 18934
     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
 18935
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18936
%{  /* NOCONTEXT */
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18937
    int bw = (aNumber == __MKSMALLINT(0)) ? 0 : 1;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18938
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18939
    if (__isExternalAddress(aWindowId)) {
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18940
	HWND win = _HWNDVal(aWindowId);
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18941
	int gwl;
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18942
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18943
	gwl = GetWindowLong(win, GWL_STYLE);
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18944
	if (gwl & WS_CHILD) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18945
	    SetWindow_bw(win, bw);
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18946
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18947
	    if (bw) {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18948
		gwl |= WS_BORDER;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18949
	    } else {
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18950
		gwl &= ~WS_BORDER;
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18951
	    }
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18952
	    SetWindowLong(win, GWL_STYLE, gwl);
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18953
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18954
	    /*
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18955
	     * 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
 18956
	     * border colors ... (see UIPainter code)
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18957
	     */
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 18958
#if 0
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18959
	    PostMessage(win, WM_NCPAINT, 0, 0);
2348
9a229f591de7 do early vieBackground fill (in event thread);
Claus Gittinger <cg@exept.de>
parents: 2345
diff changeset
 18960
#endif
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18961
	    {
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18962
		RECT rect;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18963
		HRGN rgn;
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18964
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18965
		GetWindowRect(win, &rect);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18966
		rgn = CreateRectRgn(rect.left, rect.top, rect.right, rect.bottom);
5062
eca7f3dd78b7 unicode input
Claus Gittinger <cg@exept.de>
parents: 5027
diff changeset
 18967
		DefWindowProcW(win, WM_NCPAINT, (WPARAM)rgn, 0);
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18968
		_DeleteObject(rgn, __LINE__);
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 18969
	    }
2345
2a39ca8e8b77 more resize (with borderWidth) fixes;
Claus Gittinger <cg@exept.de>
parents: 2344
diff changeset
 18970
	}
2344
998408fb085c borderWidth fixes.
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
 18971
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18972
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18973
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18974
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18975
setWindowClass:wClass name:wName in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18976
    "define class and name of a window.
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18977
     This may be used by the window manager to
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18978
     select client specific resources."
2420
a0a611f5197a CACHE DC
Claus Gittinger <cg@exept.de>
parents: 2419
diff changeset
 18979
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18980
%{  /* NOCONTEXT */
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 18981
    DPRINTF(("WinWorkstation [info]: setWindowClass:name:in: not (yet) implemented\n"));
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18982
%}.
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18983
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 18984
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18985
setWindowGravity:how in:aWindowId
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18986
    "set the window gravity - this makes the view to move
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18987
     automatically and can avoid redraws (if used properly)"
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 18988
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 18989
%{  /* NOCONTEXT */
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18990
    int gr = GRAVITY_NONE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18991
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18992
    if (__isExternalAddress(aWindowId)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18993
	HWND hWnd = _HWNDVal(aWindowId);
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18994
	localWindowInfo *lI;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18995
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18996
	if (how == @symbol(South)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18997
	    gr = GRAVITY_S;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18998
	} else if (how == @symbol(SouthWest)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 18999
	    gr = GRAVITY_SW;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 19000
	} else if (how == @symbol(SouthEast)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 19001
	    gr = GRAVITY_SE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 19002
	} else if (how == @symbol(North)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 19003
	    gr = GRAVITY_N;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 19004
	} else if (how == @symbol(NorthWest)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 19005
	    gr = GRAVITY_NW;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 19006
	} else if (how == @symbol(NorthEast)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 19007
	    gr = GRAVITY_NE;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 19008
	} else if (how == @symbol(East)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 19009
	    gr = GRAVITY_E;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 19010
	} else if (how == @symbol(West)) {
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 19011
	    gr = GRAVITY_W;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 19012
	}
4481
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 19013
	lI = GETLOCALWINDOWINFOPTR(hWnd);
e9379ad473c8 code cleanup (compiler warnings should not be ignored !)
Claus Gittinger <cg@exept.de>
parents: 4478
diff changeset
 19014
	if (lI) {
2629
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 19015
	    lI->viewGravity = gr;
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 19016
	}
d5fcb2aa3181 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
 19017
    }
2310
0ca46bcbfc05 commenting, made some functions static,
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
 19018
%}.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19019
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19020
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 19021
setWindowIcon:aForm mask:aMaskForm in:aWindowId
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 19022
    "set a windows icon & iconMask"
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 19023
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 19024
    |wiconId wmaskId wiconHeight wiconWidth|
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 19025
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 19026
    aForm notNil ifTrue:[
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 19027
	wiconId := aForm id.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 19028
	wiconHeight := aForm height.
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 19029
	wiconWidth  := aForm width.
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 19030
	aMaskForm notNil ifTrue:[
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 19031
	    wmaskId := aMaskForm id
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 19032
	].
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 19033
	self
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 19034
	    primSetWindowIconId:wiconId
2554
7cb1d03d4d47 some fixes in the window-icon handling;
Claus Gittinger <cg@exept.de>
parents: 2538
diff changeset
 19035
	    maskId:wmaskId
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 19036
	    width:wiconWidth
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 19037
	    height:wiconHeight
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 19038
	    in:aWindowId
1676
9016c45cfd81 fixed solid draws & some event stuff; better.
Claus Gittinger <cg@exept.de>
parents: 1482
diff changeset
 19039
    ].
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19040
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19041
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19042
setWindowIconWindow:aView in:aWindowId
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19043
    "define a window to be used as icon.
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19044
     This is not supported with Windows (is it possible at all ?)."
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19045
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19046
    'WinWorkstation [info]: setWindowIconWindow:in: not implemented' infoPrintCR.
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19047
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19048
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19049
setWindowMinExtent:minExt maxExtent:maxExt in:aWindowId
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19050
    "set a windows minimum & max extents.
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19051
     nil arguments are ignored."
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19052
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19053
    |minW minH maxW maxH|
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19054
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19055
    minExt notNil ifTrue:[
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19056
	minW := minExt x.
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19057
	minH := minExt y.
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19058
    ].
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19059
    maxExt notNil ifTrue:[
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19060
	maxW := maxExt x.
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19061
	maxH := maxExt y.
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19062
    ].
4113
464a850c875a preps for undecorated winStyle
Claus Gittinger <cg@exept.de>
parents: 4092
diff changeset
 19063
%{
2684
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19064
    if (__isExternalAddress(aWindowId)) {
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19065
	HWND win = _HWNDVal(aWindowId);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19066
	RECT rec;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19067
	int winStyleBits;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19068
	int winExStyleBits;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19069
	localWindowInfo *lI;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19070
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19071
	if (win) {
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19072
	    winStyleBits = GetWindowLong(win, GWL_STYLE);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19073
	    winExStyleBits = GetWindowLong(win, GWL_EXSTYLE);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19074
	    lI = GETLOCALWINDOWINFOPTR(win);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19075
	    if (! lI) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 19076
		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
 19077
		RETURN (self);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19078
	    }
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19079
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19080
	    if (__bothSmallInteger(minW, minH)) {
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19081
		RECT rec;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19082
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19083
		rec.left = 0;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19084
		rec.top = 0;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19085
		rec.right = __intVal(minW);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19086
		rec.bottom = __intVal(minH);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19087
#ifdef ADJUSTWINDOW
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19088
		AdjustWindowRectEx(&rec, winStyleBits, 0, winExStyleBits);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19089
#endif
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19090
		lI->minWidth = rec.right - rec.left;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19091
		lI->minHeight = rec.bottom - rec.top;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19092
	    }
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19093
	    if (__bothSmallInteger(maxW, maxH)) {
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19094
		RECT rec;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19095
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19096
		rec.left = 0;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19097
		rec.top = 0;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19098
		rec.right = __intVal(maxW);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19099
		rec.bottom = __intVal(maxH);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19100
#ifdef ADJUSTWINDOW
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19101
		AdjustWindowRectEx(&rec, winStyleBits, 0, winExStyleBits);
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19102
#endif
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19103
		lI->maxWidth = rec.right - rec.left;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19104
		lI->maxHeight = rec.bottom - rec.top;
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19105
	    }
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19106
	}
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19107
    }
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19108
%}
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19109
!
f8ef5e73fce5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2683
diff changeset
 19110
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19111
setWindowName:aString in:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19112
    "define a windows name"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19113
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19114
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19115
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19116
    if (__isExternalAddress(aWindowId)) {
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19117
	HWND win = _HWNDVal(aWindowId);
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19118
	wchar_t nameBuffer[ MAX_LABEL_SIZE ];
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19119
5485
5c2f4a4e16da isString -> isStringLike
Claus Gittinger <cg@exept.de>
parents: 5440
diff changeset
 19120
	if (__isStringLike(aString)) {
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19121
	    ch2wch((char *)__stringVal(aString), nameBuffer, MAX_LABEL_SIZE);
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19122
	    SetWindowTextW(win, nameBuffer);
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19123
	    RETURN (self);
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19124
	}
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19125
	if (__isUnicode16String(aString)) {
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19126
	    int l = __unicode16StringSize(aString);
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19127
	    if (l >= MAX_LABEL_SIZE) l = MAX_LABEL_SIZE-1;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19128
	    memmove(nameBuffer, __unicode16StringVal(aString), l*sizeof(wchar_t));
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19129
	    nameBuffer[ l ] = 0;
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19130
	    SetWindowTextW(win, nameBuffer);
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19131
	    RETURN (self);
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19132
	}
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19133
    }
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19134
%}
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19135
    "
7991
09cc63f1c5c8 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7680
diff changeset
 19136
     (StandardSystemView new label:'äöü') open
5067
e03d6ce6b5e7 unicode in windowTitle
Claus Gittinger <cg@exept.de>
parents: 5063
diff changeset
 19137
    "
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19138
!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19139
2755
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19140
setWindowShapeEllipticalX:x Y:y width:w height:h in:aWindowId
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19141
    "set the windows shape to an elliptical region"
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19142
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19143
%{
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19144
    if (__isExternalAddress(aWindowId)
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19145
     && __bothSmallInteger(x, y)
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19146
     && __bothSmallInteger(w, h)) {
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19147
	HWND win = _HWNDVal(aWindowId);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19148
	int left = __intVal(x);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19149
	int top = __intVal(y);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19150
	int right = left + __intVal(w);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19151
	int bottom = top + __intVal(h);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19152
	HRGN rgn;
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19153
	HDC winDC;
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19154
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19155
	rgn = CreateEllipticRgn(left, top, right, bottom);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19156
	if (rgn) {
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19157
	    winDC = GetDCEx(win, 0, DCX_WINDOW);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19158
	    if (winDC) {
5269
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 19159
#ifdef GDIFLUSH_WHEN_CHANGING_CLIP
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 19160
		GdiFlush();
228502f3be02 GDIFlush when changing clip (DELL problem)
Claus Gittinger <cg@exept.de>
parents: 5248
diff changeset
 19161
#endif
2755
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19162
		if (SelectClipRgn(winDC, rgn) == ERROR ) {
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 19163
		    console_fprintf(stderr, "select clipping region failed\n");
2755
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19164
		}
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19165
		ReleaseDC(win, winDC);
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19166
	    }
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19167
	    else
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 19168
		console_fprintf(stderr, "getDC failed\n");
2759
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 19169
1b78ab98b22b redraw the border when it changes;
Claus Gittinger <cg@exept.de>
parents: 2755
diff changeset
 19170
	    _DeleteObject(rgn, __LINE__);
2755
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19171
	}
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19172
	else
4726
d3edd9f38237 debug prints
Claus Gittinger <cg@exept.de>
parents: 4713
diff changeset
 19173
	    console_fprintf(stderr, "region creation failed\n");
2755
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19174
	RETURN ( self );
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19175
    }
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19176
%}.
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19177
    self primitiveFailed
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19178
!
ff1854ac742d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2754
diff changeset
 19179
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19180
topWindowIdsDo:aBlock
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19181
    |l|
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19182
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19183
    l := OrderedCollection new.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19184
    self primEnumWindowsInto:l.
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19185
    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
 19186
	(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
 19187
	    "/ a topView
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 19188
	    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
 19189
	]
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19190
    ].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19191
    ^ nil
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19192
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19193
    "
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 19194
     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
 19195
	|nm|
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 19196
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 19197
	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
 19198
	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
 19199
	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
 19200
	Transcript showCR:nm.
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19201
     ].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19202
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19203
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19204
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19205
     |w|
5363
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 19206
     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
 19207
	|nm|
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 19208
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 19209
	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
 19210
	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
 19211
	(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
 19212
	    w := id.
852e5877c1d9 an error in TextOutA is no longer ignored, but triggers a primitiveFailure
Claus Gittinger <cg@exept.de>
parents: 5362
diff changeset
 19213
	]
5332
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19214
     ].
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19215
     Display resizeWindow:w width:1024 height:1024
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19216
    "
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19217
!
064c01f1b4c9 +send button event stuff
Claus Gittinger <cg@exept.de>
parents: 5330
diff changeset
 19218
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19219
unmapWindow:aWindowId
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19220
    "make a window invisible"
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19221
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19222
%{  /* NOCONTEXT */
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19223
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19224
    if (__isExternalAddress(aWindowId)) {
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19225
	HWND win = _HWNDVal(aWindowId);
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19226
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19227
	if (win) {
2253
864c30e95b4b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2251
diff changeset
 19228
	    CPRINTF(("unmapWindow %x\n",win));
3713
9c89f2cca85a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3632
diff changeset
 19229
	    SetWindow_unmapping(win, 1);
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19230
	    ShowWindowAsync(win, SW_HIDE);
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19231
	}
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19232
	RETURN ( self );
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19233
    }
2000
3327602cb32e too many changes to be listed
Claus Gittinger <cg@exept.de>
parents: 1920
diff changeset
 19234
%}
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19235
!
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19236
4490
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 19237
unmapWindow:aWindowId animation:animationSymbolorNil time:timeInMillisOrNil
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 19238
    "make a window invisible with some animation effect."
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 19239
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 19240
    self animateWindow:aWindowId show:false animation:animationSymbolorNil time:timeInMillisOrNil
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 19241
!
66a98e08afb9 preps for animated map/unmap
Claus Gittinger <cg@exept.de>
parents: 4488
diff changeset
 19242
2653
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19243
windowIsIconified:aWindowId
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19244
    "return true, if some window is iconified."
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19245
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19246
%{  /* NOCONTEXT */
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19247
    if (__isExternalAddress(aWindowId)) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19248
	HWND win = _HWNDVal(aWindowId);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19249
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19250
	if (win) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19251
	    if (GetWindow_iconified(win)) {
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19252
		RETURN (true);
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19253
	    }
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19254
	}
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19255
    }
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19256
%}.
f0ca966a5636 iconify/deiconify;
Claus Gittinger <cg@exept.de>
parents: 2643
diff changeset
 19257
    ^ false
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19258
! !
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19259
4243
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19260
!WinWorkstation methodsFor:'window stuff-native'!
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19261
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19262
enableScrollBar:howSymbol in:aWindowId
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19263
    "native scrollBar widget access"
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19264
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19265
%{
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19266
    if (__isExternalAddress(aWindowId)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19267
	HWND win = _HWNDVal(aWindowId);
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19268
	int how;
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19269
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19270
	if (howSymbol == @symbol(ENABLE_BOTH)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19271
	    how = ESB_ENABLE_BOTH;
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19272
	} else if (howSymbol == @symbol(DISABLE_LTUP)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19273
	    how = ESB_DISABLE_LTUP;
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19274
	} else if (howSymbol == @symbol(DISABLE_RTDN)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19275
	    how = ESB_DISABLE_RTDN;
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19276
	} else if (howSymbol == @symbol(DISABLE_BOTH)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19277
	    how = ESB_DISABLE_BOTH;
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19278
	} else {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19279
	    RETURN ( self );
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19280
	}
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19281
	NDPRINTF(("EnableScrollBar(%d)\n", how));
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19282
	EnableScrollBar(win, SB_CTL, how);
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19283
	RETURN ( self );
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19284
    }
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19285
%}.
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19286
    self primitiveFailed
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19287
!
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19288
4247
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19289
setScrollBarPageSize:sz redraw:redraw in:aWindowId
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19290
    "native scrollBar widget access"
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19291
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19292
%{
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19293
    if (__isExternalAddress(aWindowId)
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19294
     && __isSmallInteger(sz)) {
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19295
	HWND win = _HWNDVal(aWindowId);
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19296
	SCROLLINFO info;
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19297
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19298
	info.cbSize = sizeof(SCROLLINFO);
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19299
	info.nPage = __intVal(sz);
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19300
	info.fMask = SIF_PAGE;
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
 19301
	NDPRINTF2(("SetScrollPage(%d)\n", __intVal(sz)));
4247
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19302
	SetScrollInfo(win, SB_CTL, &info, redraw==true ? 1 : 0);
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19303
	RETURN ( self );
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19304
    }
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19305
%}.
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19306
    self primitiveFailed
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19307
!
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19308
4243
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19309
setScrollPosition:newPosition redraw:redraw in:aWindowId
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19310
    "native scrollBar widget access"
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19311
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19312
%{
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19313
    if (__isExternalAddress(aWindowId)
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19314
     && __isSmallInteger(newPosition)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19315
	HWND win = _HWNDVal(aWindowId);
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19316
4253
75016f6083c1 *** empty log message ***
ca
parents: 4249
diff changeset
 19317
	NDPRINTF2(("SetScrollPos(%d)\n", __intVal(newPosition)));
4247
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19318
	SetScrollPos(win, SB_CTL, __intVal(newPosition), redraw==true ? 1 : 0);
4243
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19319
	RETURN ( self );
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19320
    }
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19321
%}.
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19322
    self primitiveFailed
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19323
!
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19324
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19325
setScrollRange:min to:max redraw:redraw in:aWindowId
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19326
    "native scrollBar widget access"
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19327
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19328
%{
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19329
    if (__isExternalAddress(aWindowId)
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19330
     && __bothSmallInteger(min, max)) {
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19331
	HWND win = _HWNDVal(aWindowId);
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19332
4265
c7588de5d8e6 *** empty log message ***
ca
parents: 4263
diff changeset
 19333
	NDPRINTF2(("SetScrollRange(%d..%d)\n", __intVal(min), __intVal(max)));
4247
3a474060ea48 *** empty log message ***
ca
parents: 4243
diff changeset
 19334
	SetScrollRange(win, SB_CTL, __intVal(min), __intVal(max), redraw==true ? 1 : 0);
4243
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19335
	RETURN ( self );
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19336
    }
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19337
%}.
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19338
    self primitiveFailed
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19339
! !
b3a87004ffd1 *** empty log message ***
ca
parents: 4242
diff changeset
 19340
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19341
!WinWorkstation::AlphaBlendParameters methodsFor:'accessing'!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19342
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19343
at:index
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19344
    ^ self instVarAt:index
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19345
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19346
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19347
blueMask
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19348
    ^ blueMask
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19349
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19350
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19351
blueMask:something
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19352
    blueMask := something.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19353
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19354
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19355
greenMask
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19356
    ^ greenMask
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19357
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19358
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19359
greenMask:something
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19360
    greenMask := something.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19361
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19362
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19363
padding
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19364
    ^ padding
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19365
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19366
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19367
padding:something
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19368
    padding := something.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19369
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19370
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19371
redMask
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19372
    ^ redMask
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19373
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19374
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19375
redMask:something
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19376
    redMask := something.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19377
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19378
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19379
sourceAlpha
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19380
    ^ sourceAlpha
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19381
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19382
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19383
sourceAlpha:something
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19384
    sourceAlpha := something.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19385
! !
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19386
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19387
!WinWorkstation::CopyDataStructStructure class methodsFor:'accessing'!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19388
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19389
sizeInBytes
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19390
    ExternalAddress pointerSize == 8 ifTrue:[
7613
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
 19391
	^ 24.
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19392
    ].
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19393
    ^ 12
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19394
! !
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19395
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19396
!WinWorkstation::CopyDataStructStructure class methodsFor:'instance creation'!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19397
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19398
new
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19399
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19400
    ^super new: self sizeInBytes
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19401
! !
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19402
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19403
!WinWorkstation::CopyDataStructStructure methodsFor:'accessing'!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19404
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19405
cbData
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19406
    ExternalAddress pointerSize == 8 ifTrue:[
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 19407
	^ self unsignedInt32At: 8 + 1.
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19408
    ].
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19409
    ^ self unsignedInt32At: 4 + 1.
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19410
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19411
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19412
cbData: cbData
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19413
    ExternalAddress pointerSize == 8 ifTrue:[
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 19414
	self unsignedInt32At: 8 + 1  put: cbData.
7601
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 19415
    ] ifFalse:[
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 19416
	self unsignedInt32At: 4 + 1  put: cbData.
7601
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 19417
    ].
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19418
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19419
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19420
dwData
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19421
    ExternalAddress pointerSize == 8 ifTrue:[
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 19422
	^ self unsignedInt64At: 0 + 1.
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19423
    ].
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19424
    ^ self unsignedInt32At: 0 + 1.
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19425
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19426
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19427
dwData: dwData
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19428
    ExternalAddress pointerSize == 8 ifTrue:[
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 19429
	self unsignedInt64At: 0 + 1 put:dwData.
7601
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 19430
    ] ifFalse:[
7605
102b25e1e61b #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7601
diff changeset
 19431
	self unsignedInt32At: 0 + 1 put:dwData.
7601
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 19432
    ].
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19433
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19434
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19435
lpData
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19436
    ExternalAddress pointerSize == 8 ifTrue:[
7613
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
 19437
	^ self unsignedInt64At: 16 + 1.
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19438
    ].
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19439
    ^ self unsignedInt32At: 8 + 1.
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19440
!
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19441
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19442
lpData: lpData
7598
fa0cfb5cedc1 #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 7509
diff changeset
 19443
    ExternalAddress pointerSize == 8 ifTrue:[
7613
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
 19444
	self unsignedInt64At: 16 + 1  put: lpData.
7601
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 19445
    ] ifFalse:[
7613
604b12dca154 Fix type mismatch in previous version
Stefan Vogel <sv@exept.de>
parents: 7605
diff changeset
 19446
	self unsignedInt32At: 8 + 1  put: lpData.
7601
32eb7cdadd8a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7598
diff changeset
 19447
    ].
5018
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19448
! !
0a7b37e2721c sendMessage
fm
parents: 5010
diff changeset
 19449
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19450
!WinWorkstation::MonitorInfo methodsFor:'accessing'!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19451
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
 19452
bounds
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
 19453
     "return a rectangle representing the displays bounding box of the monitor"
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
 19454
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
 19455
"/ ******* MULTI SCREEN ******
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
 19456
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
 19457
    ^ Rectangle
5646
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 19458
	left:screenX
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 19459
	top:screenY
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 19460
	width:workW - 1
Claus Gittinger <cg@exept.de>
parents: 5645
diff changeset
 19461
	height:workH - 1
5615
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
 19462
!
b1cfd445cef6 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5607
diff changeset
 19463
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19464
isPrimary
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19465
    ^ isPrimary
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19466
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19467
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19468
name
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19469
    ^ name
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19470
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19471
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19472
screenHeight
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19473
    ^ screenH
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19474
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19475
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19476
screenWidth
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19477
    ^ screenW
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19478
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19479
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19480
screenX
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19481
    ^ screenX
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19482
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19483
5330
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 19484
screenX:screenXArg screenY:screenYArg screenWidth:screenWArg screenHeight:screenHArg
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 19485
    workX:workXArg workY:workYArg workWidth:workWArg workHeight:workHArg
eb0bfc409b60 *** empty log message ***
sr
parents: 5329
diff changeset
 19486
    isPrimary:isPrimaryArg name:nameArg
5329
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19487
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19488
    screenX := screenXArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19489
    screenY := screenYArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19490
    screenW := screenWArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19491
    screenH := screenHArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19492
    workX := workXArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19493
    workY := workYArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19494
    workW := workWArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19495
    workH := workHArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19496
    isPrimary := isPrimaryArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19497
    name := nameArg.
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19498
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19499
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19500
screenY
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19501
    ^ screenY
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19502
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19503
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19504
workHeight
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19505
    ^ workH
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19506
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19507
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19508
workWidth
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19509
    ^ workW
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19510
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19511
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19512
workX
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19513
    ^ workX
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19514
!
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19515
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19516
workY
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19517
    ^ workY
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19518
! !
188f9a925996 monitor queries added;
Claus Gittinger <cg@exept.de>
parents: 5322
diff changeset
 19519
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19520
!WinWorkstation::PrinterDeviceContextHandle class methodsFor:'documentation'!
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19521
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19522
documentation
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19523
"
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19524
    This is used as a finalization handle for printer contexts
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19525
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19526
    [see also:]
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 19527
	DeviceHandle
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19528
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19529
    [author:]
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 19530
	Claus Gittinger
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19531
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19532
"
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19533
! !
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19534
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19535
!WinWorkstation::PrinterDeviceContextHandle methodsFor:'finalization'!
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19536
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19537
finalize
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19538
    "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
 19539
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19540
    |id|
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19541
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19542
    (id := gcId) notNil ifTrue:[
4503
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 19543
	gcId := nil.
Claus Gittinger <cg@exept.de>
parents: 4491
diff changeset
 19544
	device destroyPrinterDC:id.
4488
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19545
    ]
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19546
! !
9326e2cbfa48 first experiements for printing
Claus Gittinger <cg@exept.de>
parents: 4481
diff changeset
 19547
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19548
!WinWorkstation class methodsFor:'documentation'!
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19549
1127
a1ca516dc7ab *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1065
diff changeset
 19550
version
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 19551
    ^ '$Header$'
5362
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 19552
!
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 19553
7c945e7c8ea6 #set*Color:*
Stefan Vogel <sv@exept.de>
parents: 5342
diff changeset
 19554
version_CVS
7300
f50e0af3caba #TUNING by stefan
Stefan Vogel <sv@exept.de>
parents: 6601
diff changeset
 19555
    ^ '$Header$'
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19556
! !
3971
a6508d71b9ba *** empty log message ***
ca
parents: 3969
diff changeset
 19557
6007
0400ac2a7eb3 class: WinWorkstation
Claus Gittinger <cg@exept.de>
parents: 6004
diff changeset
 19558
2232
77cbfa090766 md's changes
Claus Gittinger <cg@exept.de>
parents: 2151
diff changeset
 19559
WinWorkstation initialize!